Transformation rule, Mapping IC based on account property

New Contributor III


The data I am loading have a lot of wrong account/IC combinations and my load fails because of those.

I want to create an expression rule to say:

if the 'Is IC Account' property for target account in OneStream is not set to True; then map to IC#None


Do normal mappings.

Any help appreciated


Valued Contributor

Hi @GorkemSenol 

It sounds like you do not have quality data in your source for your IC. I would suggest that you solve this in your source.
An alternative could be to do the "opposite" and map all your accout and then use a mask rule to map all the rest to IC#None using * to None. That would be the easiest option.

Connect with me on:
If you want to lift yourself up, lift up someone else.

Thanks Nicolas,
Yes but it's not an option to fix the issues in the source at the moment. I've written an expression to check if the target accounts ICP property is set to True or false. But since this mapping is being picked up by all the lines, the rest of the mappings are completely ignored. I'm sharing my expression below:
'Grab the target account value   
Dim vaccount As String = args.GetTarget("A#")
Dim vAcc_ID As Integer =,dimtype.Account.ID,vaccount)
'Grab the is IC property
Dim vAccountIC As String = BRApi.Finance.Account.IsIC(si, vAcc_ID).ToString
Dim vIC As String = args.GetSource("IC#")
'brapi.ErrorLog.LogMessage(si, vaccountic)
If (vAccountIC = "FalseValue") Then
Return "None"
' Return args.GetSource("IC#")
This should allow the mapping for these accounts should be done normally
End If

Valued Contributor

I hear you! The problem is then the order of the Transformation. I presume you are using this in a mask rule? Then it means you can not use One To Ones then... remember the order: SourceDerivative, OneToOne, Composite, Range, List, Mask... but if you push this BR to the Mask as it is the last the ones before can not be used. 
Use the Order in the mask and push your code to be used as the first one....

Connect with me on:
If you want to lift yourself up, lift up someone else.



Make sure the Account Dimension is being processed before the IC dimension.  You do this on the Integration tab of the Cube properties: