Forum Discussion

SKMundra's avatar
SKMundra
New Contributor III
3 years ago

GetDataCell in Dynamic calc in U8 - unable to pull values from diff time periods

Hello Everyone, 

Looking for a quick help Please.

Here I am trying to write a Dynamic Calculation code which will follow the exact logic of PVA translation however will use rates from previous year.

So kind of a Constant currency solution.

However when I am in Time period 2, I am unable to pull data from different periods, This calculation works If I make my T#Hardcoded e.g. 2020M1/2020M2.

Current outcome is all zeros 😞

Please help with any solution anyone has or can point me to right direction - since unable to understand what is missing.

 

Thanks

Satish

 

 

  • You can use databuffers to help you with debugging:

    Dim logSource As DataBuffer = api.Data.GetDataBufferUsingFormula("Your Formula's right side")
    logSource.LogDataBuffer(api, "The source", 100000)

    You will get all valid intersections of the databuffer as a list in the error log.

  • db_pdx's avatar
    db_pdx
    Valued Contributor

    Hi SKMundra: two things to check:

    1) Try dropping the ending .CellAmount property from the end of your calculation.  Your GetDataCell will contain the math.  We have some similar FX related UD8's.  Our calc looks like: 

    Return api.Data.GetDataCell("U8#None:C#Local * " & rateAverage)

    2) Validate that your PeriodicRate1 is not 0.  You can use the BRApi.ErrorLog.LogMessage(...) for simple debugging.  But be mindful that for a UD8 formula it will log a message or every cell it is calculating.

    Cheers,

    -DB

    • ChristianW's avatar
      ChristianW
      Valued Contributor

      You can use databuffers to help you with debugging:

      Dim logSource As DataBuffer = api.Data.GetDataBufferUsingFormula("Your Formula's right side")
      logSource.LogDataBuffer(api, "The source", 100000)

      You will get all valid intersections of the databuffer as a list in the error log.