02-29-2024 10:22 AM - last edited on 03-01-2024 05:01 AM by JackLacava
In my cube view, I need a column (% of net sales) to calculate each row/divided by net sales. In the selected column I am trying to only solve for actual. For example actual gross sales/actual net sales, and then actual sales rebates/actual net sales, and so on down my P&L. There must be a way but I have not found anything useful. I'd greatly appreciate any help.
Solved! Go to Solution.
02-29-2024 12:31 PM
Hi BenMannes: you're on the right track, but just slightly off with your GetDataCell. You'll want to divide the column Actual, by the intersection of [Net Sales]-Actual. The below assumes the row [Net Sales] generates only 1 result, and the column Actual generates only 1 result
GetDataCell(Divide(CVC(Actual), CVRC([Net Sales], 1, Actual, 1))):Name(% of Net Sales)
That said, if you have multiple reports that need to show % of Net Sales consider putting it into a DynamicCalc helper, that way you just append the helper to your member filter (:U8#PercentOfNetSales, for example) and you can avoid the complex GetDataCell math.
Cheers, -db
02-29-2024 10:40 AM - last edited on 03-22-2024 11:57 AM by JackLacava
I believe you should write a dynamic calculation in U8 dim instead of doing CV math. Write it as follows:
Dim acct As Member = api.Pov.Account
If (Not ViewMember.IsAnnotationTypeViewId(api.Pov.View.MemberId)) Then
Return api.data.GetDataCell("Divide(A#[" + acct.Name + "]:U8#None,A#NetRev:U2#Top:U8#None)")
End If
Return Nothing
Then pull U8#PctofSales in that column on the report.
02-29-2024 12:31 PM
Hi BenMannes: you're on the right track, but just slightly off with your GetDataCell. You'll want to divide the column Actual, by the intersection of [Net Sales]-Actual. The below assumes the row [Net Sales] generates only 1 result, and the column Actual generates only 1 result
GetDataCell(Divide(CVC(Actual), CVRC([Net Sales], 1, Actual, 1))):Name(% of Net Sales)
That said, if you have multiple reports that need to show % of Net Sales consider putting it into a DynamicCalc helper, that way you just append the helper to your member filter (:U8#PercentOfNetSales, for example) and you can avoid the complex GetDataCell math.
Cheers, -db
02-29-2024 12:54 PM
That is perfect. Thanks so much for the help on this!
Ben