Marco
3 days agoContributor II
How can I subtract the result of two DIVIDE operations within a CALCULATE function?
Hi Everyone.
I have the following CALCULATE expression, but it’s returning no results. The source values are not zero, so I’m not sure if the way I’m using the DIVIDE function is causing the issue, or if there is another problem
Dim DBCInner As DataBuffer = api.Data.GetDataBufferUsingFormula("FilterMembers(A#RETBUYBACK:E#" & strEntTx3 & ":C#Local:O#Top:U2#INNER:UD3#COUNTRY_RPT + A#423100:E#" & strEntTx3 & ":C#Local:O#Top:U2#INNER:UD3#COUNTRY_RPT + A#411000:E#" & strEntTx3 & ":C#Local:O#Top:U2#INNER:UD3#COUNTRY_RPT)")
api.Data.FormulaVariables.SetDataBufferVariable("DBCInner",DBCInner,False)
Dim regionalRpt As DataBuffer = api.Data.GetDataBufferUsingFormula("FilterMembers(A#RETBUYBACK:E#" & strEntTx3 & ":C#Local:O#Top:U2#INNER:UD3#REGIONAL_RPT + A#423100:E#" & strEntTx3 & ":C#Local:O#Top:U2#INNER:UD3#REGIONAL_RPT + A#411000:E#" & strEntTx3 & ":C#Local:O#Top:U2#INNER:UD3#REGIONAL_RPT)")
api.Data.FormulaVariables.SetDataBufferVariable("rptValue",regionalRpt,False)
api.Data.Calculate("A#P_EBIPrct:O#Import:U2#P0000:UD3#REG_ADJ:U4#PJ00000 = Divide($rptValue,A#411000:E#"& strEntTx3 &":C#Local:O#Top:U2#INNER:UD3#REGIONAL_RPT) - Divide($DBCInner, A#411000:E#" & strEntTx3 & ":C#Local:O#Top:U2#INNER:UD3#COUNTRY_RPT)")
I would appreciate your assistance.