Skip to main content
Newcomer
Dec 6, 2023 7:15 PM UTC

datacalculate help

Dear Community:

I am trying to add a previous year M12 balance to a SCF report.  I can't seem to get prior year data to come over.  However, If I code the amount it does work.

' api.Data.calculate("A#CF_RepaymentEquityInvestment = A#CF_RepaymentEquityInvestment + A#33100:T#POVPriorYearM12") does not work

' api.Data.calculate("A#CF_RepaymentEquityInvestment = A#CF_RepaymentEquityInvestment + A#33100:T#2022M12") does not work

' api.Data.calculate("A#CF_RepaymentEquityInvestment = A#CF_RepaymentEquityInvestment + A#33100") does not work

api.Data.calculate("A#CF_RepaymentEquityInvestment = A#CF_RepaymentEquityInvestment + -62225") ' Returns amount as intended

 

Thanks

6 replies

Veteran
Dec 7, 2023 7:54 AM UTC

Hi Spalomino 
The value you have of 62225, can  you see it in your cuve view? Did you right click on its cell and analysed the cell POV and all its intersection? Did you do the same for A#CF_RepaymentEquityInvestment?

SpalominoAuthor
Newcomer
Dec 11, 2023 3:47 PM UTC

Nicolas:  Thanks for responding.  Yes, the data [$62,225] is sitting our cube.

Veteran
Dec 12, 2023 7:37 AM UTC

can you paste here the cell POV intersections for us to see? Did you try to add it this directly in the formulae? 

Employee - Sage
Dec 14, 2023 4:51 PM UTC

You have to remember that, when using Calculate, you're working with databuffers, not single cells like in GetDataCell. The dimensionality of databuffers has to match, so things like your first attempt are a non-starter: one buffer only has Account specified, and the other has Account and Time.

If you balance the buffer dimensionality, it should work:

api.Data.calculate("A#CF_RepaymentEquityInvestment = A#CF_RepaymentEquityInvestment:T#Pov + A#33100:T#PovPriorYear12")

If not, you should investigate what those buffers actually contain, i.e. if you're ever going to have values in the same intersections on both sides. Check out GetDataBufferUsingFormula and LogDataBuffer for that.

SpalominoAuthor
Newcomer
Dec 14, 2023 5:11 PM UTC

Jack:

Thanks for the information.  I will pursue the GetDataBuffer and LogDataBuffer approach.  

Best