Forum Discussion

WillVitale's avatar
WillVitale
Contributor
6 months ago

Max Calculation in CV

Hello, I'm writing a cube view and our old report (not in OS) has a max value calculation in the columns that looks at the current years values for each entity. I tried writing a GetDataCell(Max(A#...
  • Henning's avatar
    Henning
    6 months ago

    Here is a simple example, displaying the max amount of the prior two periods. I set up a UD8 member:

    ...which returns the max amount from my account 40000 from T#POVPrior1 and 2 using this member formula:

    Dim dAmount_1 As Decimal = api.Data.GetDataCell("A#40000:T#PovPrior1:U8#None").CellAmount
    Dim dAmount_2 As Decimal = api.Data.GetDataCell("A#40000:T#PovPrior2:U8#None").CellAmount
    
    Dim myArray As Decimal() = New Decimal(){dAmount_1, dAmount_2}
    
    Return myArray.Max()