Forum Discussion

Jacky_C's avatar
Jacky_C
New Contributor III
8 months ago

Rounding function in GetDataCell

Hi all, Currently I have a cube view with GetDataCell formula for ad hoc calculation, may I know is there any rounding off function in the GetDataCell formula? For example, we would like to have a ...
  • KarlT's avatar
    8 months ago

    I don't know a way to achieve this within the GetDataCell but the result could be achieved like this:

    Dim dataCell1 As DataCell = api.Data.GetDataCell("A#Account1")
    Dim dataCell2 As DataCell = api.Data.GetDataCell("A#Account2")
    Dim result As Decimal = Math.Round(dataCell1.CellAmount,0) - Math.Round(dataCell2.CellAmount,0)
    Return result

    This requires the creation of a dynamic calc member however

  • Jacky_C's avatar
    Jacky_C
    8 months ago

    Hi KarlT, thanks for your suggestion on creating a dynamic calc member. I will try to create one if there is no other way to apply rounding function within the GetDataCell formula. Thank you so much.