I started this thread just over a year ago. Dave has cleverly provide a solution to my original problem of import() within the assign( function and to one raised by John Bovenmyer. I now have another which is much more complex and I just can’t get my head around it. I have this code:
I didn’t replace the assign with an array element. I replaced import() with the array element. Since the array you are filtering here is the reverse of DividendArray, I think it would be best to reverse it first, and then do the arrayfilter.
Your amendment looks correct. It looks like there is another bug associated with assign( and arrayfilter. When I tried it, it appeared that the assignment to the Carry variable was taking place prematurely during the first execution of the formula. Carry had been preset to “”, but the value of the assign( function was used instead, even though the assign( function doesn’t appear until later in the formula. For subsequent array elements, the value of the previous assign( function was used, as it should be.
On a side note, I see a couple of ways your code could be made more efficient in Panorama X.
Since Panorama X uses 64 bit integers, you don’t need to use floating point to get the precision you are after. 64 bit integers can easily handle the product of two, 6 digit decimal integers.
Thanks for all your help on this - I suspect you remember it from several years back. Unfortunately, there is a minor fault in either my logic or my programming and the results are always out by a small but significant amount so I’ve gone back to an earlier, much clumsier implementation which works perfectly. I don’t have time to do any better than that at this stage - I may return to it.