Dynamic Calc Rule

OS_Love
New Contributor III

 

Hi All

In the below example value is displayed on every single combination of UDs.  This should only be calculated and written to each UD7 separately but calculated on Tops and displayed only on “NotDefined” for all other UDs.

For any other POV combination- the result returned should be zero.

Can we do something like this?

 

Dim Tops_NoUD7 As String = ":O#Top:I#Top:F#Top:U1#Top:U2#Top:U3#Top:U4#Top:U5#Top:U6#Top:U8#Top"
Dim dEbit As Decimal = api.Data.GetDataCell("A#EBIT" & Tops_NoUD7).CellAmount
Dim dSalesProd As Decimal = api.Data.GetDataCell("A#SALESPROD" & Tops_NoUD7).CellAmount
Dim sEbitProd As Decimal = (dEbit/dSalesProd)*100
Return sEbitProd

1 REPLY 1

Henning
Valued Contributor

Hi, you need to define the other UD members that this data may be displayed on. You cannot say for all other UD members display no data. In your case this means that you can say only display data if the POV of my cube view is on "Top" for each UD member other than UD7 (E.g. by adding an if statement such as If Api.Pov.UD1.Name = "Top" etc. Else Return Nothing). Keep in mind that the cube view POV needs to be set accordingly for this dynamic account to display data - the users need to be educated accordingly.

 

On another note, your "dEbit/dSalesProd" will error our when dSalesProd is zero. When you use the Divide function, this will not happen (from Snippets "DynamicCalcDivide"):

Return api.Data.GetDataCell("Divide(A#ACCOUNT1,A#ACCOUNT2)")