I am trying to find a way to run a formulafill that will create an array of numbers then add the numbers together to put the result into a field. I can make this happen on a line by line basis by passing the array through a python script and converting it to an integer before feeding it back to the field. Is there a way to cleanly do the same with a formulafull? Here is a sample of the code that I am running to do a line by line calculation.
global vThisItem, vTotal, vItems
vItems=""
vThisItem=str(Item)[1,3]+rootstock
I am not certain I fully understand exactly what you are trying to accomplish but I will take a stab at it. I assume the field you want to fill is orderedtodate and it is a text field. Here is a method to daisy-chain two array functions to use in a formulafill:
global vThisItem, vTotal, vItems vItems=“” vThisItem=str(Item)[1,3]+rootstock
field orderedtodate
formulafill arraynumerictotal(
arraybuild(“,”,“”,{?(str(Item)[1,3]+rootstock=vThisItem,
str(val(str(Item)[-1,-1])*val(«bundle size»))}),“,”)
I tried the method before and the result gives me a “runtime error in call(procedure” message which was what led me to feeding the results of the array through a python script to begin with.
IIRC there was a known error in arraynumerictotal in Pan6. It’s fixed in PanX. I recall having some elaborate workaround for it’s lack in Pan6, but have been using PanX long enough to have forgotten it’s details. I suspect it wasn’t doable with formula fill.
Leaving a response in case someone else needs it. The call( procedure error will happen anytime you try to put a local variable in anything from the arrayLib functions (arrayfilter, arraynumericsum, etc). It should work if you change the variable scope to a global