Forum Discussion

MarkBird's avatar
MarkBird
Contributor III
2 days ago

Time dependent mappings

Hi

I'm look for a solution to perform time dependent mappings. For example:

 SourceTarget
Prior to Dec 25xy
Dec 25 onwardsxz
Has anyone come across the need for the before? And if so, what solution did you implement for this? Did you notice any issues with performance etc?
Thanks,
Mark

4 Replies

  • MarcusH's avatar
    MarcusH
    Valued Contributor

    Yes - you don't need an Else section. If the transformation rule does not return a value, it is effectively skipping that rule.

  • MarkBird's avatar
    MarkBird
    Contributor III

    Thanks Marcus

    I have a simple snippet below, but I am try to skip over the rule in the else section. Is this possible?

    Mark

    Dim currTime As String = args.GetTarget("T#")
    Dim compTime As String = "2025M12"
    
    If TimeDimHelper.GetIdFromName(currTime) < TimeDimHelper.GetIdFromName(compTime) Then
        Return args.OutputValue
    Else
        'Skip over to the next rule
    End If
  • MarcusH's avatar
    MarcusH
    Valued Contributor

    This depends on whether you need to re-transform previous periods. If you do not need to, then you just update your mappings in Dec 25. The actual mappings that were used to transform the data is saved so you will not lose the previous periods' mappings. If you do need to re-transform previous periods then the easiest way is to use a Complex Expression. Use args.GetSource("T#") or args.GetTarget("T#") to get the Time member and then process that according to the period. You can search this forum for GetSource and GetTarget for more info and examples.