Power Formulas in databuffer

giofe
New Contributor

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 2

JackLacava
Community Manager
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
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).

Please sign in! giofe