Hi Guys,
Previously I was using filtered.pop (thanks to @Alexey_Gusev) to find the last record that has no amount
let filtered=(result.records.filter(item => item.getCellValue('Cumulative by Customer') > 0));
let last=filtered.pop();
However when I am adding more data, let’s say different customers, it’s not dynamically filtering those data. The amount $12,203.50 below is based on last amount of $10,253.5 above (they are different customers). It’s supposed to take the last amount of $22,776 instead
Is it advisable to build custom index of the data or is there any better method to calculate cumulative sales amount by customer?
Thank you.