Forum Discussion

Pawel's avatar
Pawel
New Contributor II
3 months ago

remove transformation profile member by an import

Dear coleagues, 

when I need to change transformation group within multiple transformation profiles I wanted to export XML file, do the change and then reupload it. Unfortunatelly it add new group but does not remove the old one. I guess the merge approach it to blame. 

Do you know a way how to do this excersise in more sophisticated way than running a clicking derby?

Thanks for help!

  • JJones's avatar
    JJones
    New Contributor III

    Pawel,

    You should be able to modify an existing transformation rule group via XML and load it in without it creating a new group.  Within the GolfStream application as an example, I exported out the HoustonAccounts transformation rule group to XML and saved it to my desktop.  I then edited the XML in a text editor and added a new Mask rule to the file and saved it.  I then imported the XML back into the application and then went to Account Dimensions > HoustonAccounts Group > Mask and see the new transformation rule that was added to the group.  That change then flows to the profiles that the group is included within.  

  • JJones's avatar
    JJones
    New Contributor III

    If you are looking to do multiple removals from the Rule Group via XML Load/Extract, it will not remove any rules with the import/export process, it is simply to add/modify rules that are in the group.

  • Pawel's avatar
    Pawel
    New Contributor II

    Hi JJ, 

    What we have in our application is list of various Tranformation Groups of the same dimension for different purposes. And we also have more than a few transformation profiles specific for different purpose and subsidiary. The problem is, I need to swich one group for another in many profiles. I was hoping this can be done in some automated manner (I am not lazy, I want to be super efficient 😉 ).

    I tried to play around with the XML file like using action="Delete" with no effect. I also found some procedures in BRApi.Import.Metadata but no description of how to work with that. So I was hoping somebody already know.

    Best!

    Pavel

  • Pawel's avatar
    Pawel
    New Contributor II

    It turned out it is not possible by an export/import but there is a way by stepping in the application database.

     

     

    ''' query to delete specific TR Group from TR Profiles
    
    Dim trGroupName As String = "FW_1000_COMMON"
    Dim trProfName 	As String = "___/_TB/_LOAD"
    
    Dim querry As String = $"
    
    	delete rpm
    	
    	from StageRuleProfiles rp
    		join StageRuleProfileMembers rpm on rpm.[RuleProfileKey] = rp.[UniqueID]
    		join StageRuleGroups rg on rpm.[RuleGroupKey] = rg.[UniqueID]
    	
    	where 1=1
    		and rp.[RuleProfileName] like '{trProfName}' escape '/'
    		and rg.[RuleGroupName] = '{trGroupName}'
    "
    
    'Return the DataTable
    Using dbConnApp As DBConnInfo = BRAPi.Database.CreateApplicationDbConnInfo(si)
    	Return BRAPi.Database.ExecuteSql(dbConnApp, querry, False)			
    End Using

     

     

    • KarlT's avatar
      KarlT
      Contributor III

      I personally would avoid this type of SQL manipulation. 

      I'd be interested to understand the use case that requires this automation of changing the group assigned to the profile?

  • Pawel's avatar
    Pawel
    New Contributor II

    If there was a set of procedures that would help me with that I would not use this kind of manipulation... I found none. I tried this and it worked.

    The use case: 150 entites with specific profiles for loading trial balances and intercompany transactions. And I had to change one group for another for all of those entities. Export/Import does not work, it does not delete the old one. And we are not in prod yet.