Skip to main content
December 6, 2023

datacalculate help

  • December 6, 2023
  • 2 replies
  • 0 views

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

2 replies

December 7, 2023

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
December 11, 2023

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

December 12, 2023

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

December 14, 2023

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
December 14, 2023

Jack:

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

Best