Forum Discussion
In short, the error you are getting is because you are attempting to concatenate a Decimal datatype without any conversion into a String. The simple fix would be:
api.Data.Calculate("A#520000 = A#430000 *" & Var1.ToString & ")
However, the above is problematic depending on the culture of the user running the script, should let's say they format numbers as "0.000,00" rather than "0,000.00". The safer way to do what you are doing is as follows:
Dim Var1 as Decimal = Math.Round(api.Data.GetDataCell("A#630000").CellAmount, 2)
api.Data.FormulaVariables.SetDecimalVariable("Var1",Var1)
api.Data.Calculate("A#520000 = A#430000 * $Var1")
- uvrao3318 days agoNew Contributor II
Hi, the result is zero after using above script, I checked pov is correct and all source accounts have data.
- rhankey18 days agoContributor III
Well, then it is time to dump out the second data buffer to error log to see why you are getting zero. You could be encountering a constraint issue. Also dump out the value of Var1, as perhaps it is zero a NoData cell.
Related Content
- 2 years ago
- 2 years ago
- 2 years ago
- 2 years ago
- 2 years ago