Could you be more specific as to what “fails” means? Was there an error message? Empty or wrong value? What?
In Panorama 6 the lineitemarray( function did an extra special “trick” when used with arraybuild. In Panorama X this trick is not implemented (and I think I may ultimately implement this function a different way). Other than that, I don’t know of any issue with line items.
Yields a total of “0” … instead of the actual, non-zero, sum of all the payments.
For example, in the record in question, «Payment1» is 300 and «Payment2» is 60, and the rest of the «PaymentΩ» values are 0, so the total should be 360. But, they are returning 0 in the two lvB = ... examples, above.
You may be rephrasing it, but to be sure, that should be $0.00 or preferably $360.00. If in fact it’s 0 it would suggest something is amiss in the pattern.
Sum(«Payment1») shouldn’t work at all. «Payment1» would be interpreted as the root name of the Line Items so Panorama would be attempting to use «Payment11», «Payment12», «Payment13»…
You want either sum(«PaymentΩ») or sum(«Payment»). Both are working for me with a simple database I set up using your field names. As is
I have a test database with line items. So I made a simple test procedure:
let totals = arraybuild(cr(),"",{str(Price1+Price2+Price3)})
This worked fine, I got a text array with the totals for each record.
I then tried it with the pattern( function.
let totals = arraybuild(cr(),"",{pattern(Price1+Price2+Price3,"#.##")})
This also worked fine.
FInally, I tried it with the sum( function.
let totals = arraybuild(cr(),"",{sum("PriceΩ")})
This did not work - it gave the total for the currently active record over and over. I haven’t looked at the code yet but I’ve seen this issue before and the fix is probably fairly easy.
I’m not sure why you are getting zeros but there must be something wrong on your end, the basic feature does work.
The chevrons are required if the field name has punctuation or special characters in it. None of your field names have special characters, so the chevrons are optional. They won’t hurt anything though (when used in normal calculations).