Forum Discussion

giofe's avatar
giofe
New Contributor
2 years ago

Power Formulas in databuffer

Hi Team,

Could you please let us know if it's possible to use the function math.pow in a databuffer? and if yes, which is the correct syntax?

As for example Dim resultDataBuffer As DataBuffer = api.Data.GetDataBufferUsingFormula("Math.Pow(($sourceBufferMonthlyRate),$sourceDataBufferResidual)")

or maybe in a api.Data.Calculate function? 

Thank you in advance!

Giorgia

  • JackLacava's avatar
    JackLacava
    Community Manager

    You cannot use math.pow like that, try with the ^ operator, but if i remember correctly in Calculate formulas (and hence in GetDataBufferUsingFormula, which is effectively a subset of that) you're limited to the 4 main operators ( + - * / ).

    A workaround is to go cell by cell and use math.pow on the .CellAmount property, but you'll have to add "Imports System.Math" at the top - so it will have to be done in a Business Rule.

  • giofe's avatar
    giofe
    New Contributor

    Thank you for your reply! 

    Yes a workaround would be a for cycle but maybe there is a more efficient and rapid solution for evaluate two databuffer (and other math function).