cube view column calculation

BenMannes
New Contributor

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.

 

Screenshot 2024-02-29 101618.png

1 ACCEPTED SOLUTION

db_pdx
Contributor III

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

View solution in original post

3 REPLIES 3

T_Kress
Contributor III

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.

Teresa C. Kress
Principal Delivery Manager Partner Enablement | OneStream Software

db_pdx
Contributor III

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

That is perfect. Thanks so much for the help on this!

Ben