datacalculate help

Spalomino
New Contributor II

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 6

NicolasArgente
Valued Contributor

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?

Connect with me on:
LinkedIn: https://www.linkedin.com/in/nicolas-argente/
Website: https://aiqos.io
If you want to lift yourself up, lift up someone else.

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

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

Connect with me on:
LinkedIn: https://www.linkedin.com/in/nicolas-argente/
Website: https://aiqos.io
If you want to lift yourself up, lift up someone else.

Cb#ABG_FinRptg:E#Praxis:P#?:C#Local:S#Actual:T#2023M9:V#YTD:A#CF_RepaymentEquityInvestment:F#StatementChange:O#Top:I#None:U1#CF_Load_BS:U2#None:U3#None:U4#None:U5#None:U6#None:U7#None:U8#None

=XFGetCell(True, "ABG_FinRptg", "Praxis", "", "Local", "Actual", "2023M9", "YTD", "CF_RepaymentEquityInvestment", "StatementChange", "Top", "None", "CF_Load_BS", "None", "None", "None", "None", "None", "None", "None")

XFCell(Cb#ABG_FinRptg:E#Praxis:C#Local:S#Actual:T#2023M9:V#YTD:A#CF_RepaymentEquityInvestment:F#StatementChange:O#Top:I#None:U1#CF_Load_BS:U2#None:U3#None:U4#None:U5#None:U6#None:U7#None:U8#None, Culture=User, NumberFormat=N0, DisplayNoDataAsZero=True, Scale=0, FlipSign=False, ShowPercentSign=False, UseApostrophePrefix=False)

JackLacava
Community Manager
Community Manager

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.

Jack:

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

Best

Please sign in! Spalomino