Skip to main content
Member
Apr 11, 2023 4:17 PM UTC

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

2 replies

Employee - Sage
Apr 11, 2023 11:25 PM UTC

You cannot use math.pow like that, try with https://learn.microsoft.com/en-us/dotnet/visual-basic/language-reference/operators/exponentiation-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.

fede27Author
Member
Apr 12, 2023 7:49 AM UTC

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).