Forum Discussion

YahyaOS's avatar
YahyaOS
New Contributor II
8 months ago

Advanced Transformation rules mapping and Dimension Library

Hello Everyone,

I'm trying to build an advanced transformation rule based on a member present in my dimension.

For example, I want to bypass all lines that contain a member not existing in my UD3 dimension.

Currently, I use a one-to-one mapping for my UD3 members and I add a mask to bypass the rest with: * -> (Bypass). However, this method doesn't handle cases where new members are added to my UD3 dimension. Each time this happens, I have to update my one-to-one mapping.

How can I dynamically implement this using a complex rule or a business rule?

Thank you for your help.

Yahya

  • Krishna's avatar
    Krishna
    Valued Contributor

    YahyaOS  -  Here We Go

    1. You can do this in Import (Data Source) provide a static value to UD3 as ByPass and in TR you can just set One to One ByPass -> ByPass

    2. Option 2 - If the UD3 is not being used then you can disable it in the Integration in Cube Properties and remove it from Data Source and in TR.

    3. Option 3 - BR or Complex Expression. BR(Conditional Rule) is Preferred, below is the example. You can expand based on your UD3 Member.

    Dim UD3 As String = args.GetSource("UD3#")
    Dim UD3Final As String = String.Empty
    
    If TargetAcct.StartsWith("1") Then 
    
    	UD3Final = "(BYPass)"
    	
    End If
    
    return UD3Final

     

     

  • MarcusH's avatar
    MarcusH
    Contributor III

    I am assuming that the source UD3 member is the same as the OS UD3 member. You can approach this in two ways (that I can think of):

    1. Use a BR on a Transformation Rule that executes before the mask to Bypass. You use BRApi.Finance.Metadata.GetMember (as Steven mentioned) to determine if it's a valid UD3 member. If it is set the target to the source otherwise set it to Bypass.

    2. Bulk update the Transformation Rules somehow before they are used. This could be a separate BR that you run before month end reporting starts (ie run once) or call it from a TransformationEventHandler (ie runs every time). That BR gets all the base members for the UD3 dimension and updates the Transformation Rules.

    My preference would be option 2 as this keeps the audit and drill back. With option 1 you would need a process to identify which UD3 members are being mapped via the BR and add them to the Transformation Rules.

  • Steven's avatar
    Steven
    Contributor II

    Use BRApi.Finance.Metadata.GetMember.

    If this is Nothing, then Bypass

    Else

    Return MemberName

     

    • YahyaOS's avatar
      YahyaOS
      New Contributor II

      Thank you, Steven, for your help.

      Could you please provide more details( an example if possible)?, as I am new to OneStream, should I implement this in a complex expression in my Transformation Rule (TR) or in a Business Rule?

      Best regards,

      Yahya

      • Steven's avatar
        Steven
        Contributor II

        Something like this:

         

         

        Dim UD3 As String = args.GetSource("UD3#")
        Dim UD3Final As String = String.Empty
         
        Dim mem As Member =  BRApi.Finance.Metadata.GetMember(si, dimTypeId.UD3, UD3)
         
        If mem is Nothing Then 
         
        UD3Final = "(BYPass)"
         
        End If
         
        return UD3