Attempting to Show NMF in a Cube View
Hello All,
I am working on a dynamic calc in the account dimension to calculate percent margin. If the percent margin shows above 100% or below -100%, I want the cube view cell to display 'NMF'. At the moment I believe I have the syntax correct in my formula, but maybe my execution isn't right on. My suspicion is that I can't return strings for the CreateDataCellObject. Full formula below:
Any help is much appreciated!
Dim PM As Decimal
PM = CDec(api.Data.GetDataCell("Divide(A#PRODUCT_MARGIN,A#PRODUCT_REVENUE)").CellAmount)
If PM > 100 Then
Return api.Data.CreateDataCellObject("NMF", False, False)
Else If PM < -100 Then
Return api.Data.CreateDataCellObject("NMF", False, False)
Else
Return api.Data.GetDataCell("Divide(A#PRODUCT_MARGIN,A#PRODUCT_REVENUE)")
End If