Forum Discussion

OlaWidera's avatar
OlaWidera
New Contributor II
24 days ago

account is not translating

Good afternoon,

I need help with translating a balance account. We set it up to calculate job to date and load its local currency value, then I wanted to translate it using a job to date rate (also setup as the balance account).

The formula attached to the account is for every foreign base entity executes this:

api.Data.Calculate("A#JTD_COST:V#YTD:F#EndBalLoad:U8#None:C#USD = RemoveZeros(A#JTD_COST:V#YTD:F#EndBalLoad:U8#None:C#Local * A#JTD_FX_RATE:V#YTD:F#EndBalLoad:U8#None:C#Local)",,,,,"U1#Active.base")

 

The problem is that when I set the original account with  Formula Pass then I get an error during the consolidation suggesting the invalid destination data unit in script. When I don't attach any Formula Pass then nothing happens at all. 

Any suggestions what I miss or how else  balance accounts can be translated?

Thank you,

Ola 

 

 

4 Replies

  • Stefano's avatar
    Stefano
    New Contributor II

    The destination data unit should match the data unit the rule is run on. Check that the formula is only run in the destination data unit e.g. If api.Cons.IsForeignCurrencyForEntity() and api.Pov.Cons.Name = "USD" then...
    Like this you could also remove the cons dim from the destination formula part

  • cbarbieri's avatar
    cbarbieri
    New Contributor

    This is a bit old, so maybe you solved it, but just in case... we cannot use write to these dimensions on the left hand side of api.data.calculate:  Entity, Consolidation, Time, Scenario. In your first post you included C#USD on the left, which is not valid. Instead, these dimensions can be used in conditions around the calculation which you already use in your example. There are other ways to translate, but at least this will correct the error, assuming all other dimensions on the left are valid intersections.

  • JackLacava's avatar
    JackLacava
    Icon for OneStream Employee rankOneStream Employee

    If you don't assign a Formula Pass, the formula is never executed. So you will have to set a Pass and then try to fix the error (look at the message details for clues? Or report them here...).

    • OlaWidera's avatar
      OlaWidera
      New Contributor II

      thank you Jack for confirming that. the error happens during the consolidation - I can see that formula is executed and calculates how I want but then I get this error