Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to sum using previous data. That is adding the previous Daily interest to the Interest for each current day.
So, 112.83 + 0.79 = 113.62
Any ideas guys please?
Sample
Transaction Date | Transaction ID | Interest | Daily Interest |
28/03/2022 | 1115700004 | 112.83 | 0.79 |
Desired Result
Transaction Date | Transaction ID | Interest | Daily Interest |
29/03/2022 | 1115700004 | 113.62 | 0.72 |
one solution might be:
table1:
LOAD TransactionDate,
TransactionID,
DailyInterest,
RangeSum(Peek(Interest),Previous(DailyInterest)) as Interest
Inline [
TransactionDate,TransactionID,DailyInterest
27/03/2022,1115700004,112.83
28/03/2022,1115700004,0.79
29/03/2022,1115700004,0.72
30/03/2022,1115700004,0.71
31/03/2022,1115700004,0.75
01/04/2022,1115700004
];
hope this helps
Marco
Yes you should be able to do this at load using the Peek function :
one solution might be:
table1:
LOAD TransactionDate,
TransactionID,
DailyInterest,
RangeSum(Peek(Interest),Previous(DailyInterest)) as Interest
Inline [
TransactionDate,TransactionID,DailyInterest
27/03/2022,1115700004,112.83
28/03/2022,1115700004,0.79
29/03/2022,1115700004,0.72
30/03/2022,1115700004,0.71
31/03/2022,1115700004,0.75
01/04/2022,1115700004
];
hope this helps
Marco
Hi @MarcoWedel
Just out of curiosity, how would this script "RangeSum(Peek(Interest),Previous(DailyInterest))" be translated into an expression in a chart type, Many thanks.