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

SKMundra
New Contributor III

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.

SKMundra_0-1644348314859.png

Current outcome is all zeros 😞

SKMundra_1-1644348660601.png

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

 

Thanks

Satish

 

 

1 ACCEPTED SOLUTION

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.

View solution in original post

2 REPLIES 2

db_pdx
Contributor III

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
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.