I have a data set similar to the below table. For every 'Date' and 'Key' I have a 'Residual' value. This residual value will be the same for each key. However, I am having some issues with calculating the 'ResidualTotal' field. This field should be a running total of the residual values for each key. I know how to incorporate the rangesum/above function (i.e. rangesum(above(sum(residual),0,rowno()))) but I do not know how to implement it in this scenario when I do not want it by row number and I cannot replace rowno() with 'Date' and 'Key'.
Any help would be greatly appreciated.
hi there, hope this helps you , find attachment
LOAD * INLINE [
Date, Key, Residual
1/1/2014, A, 20
1/2/2014, A, 20
1/3/2014, A, 20
1/4/2014, A, 20
1/5/2014, B, 90
1/6/2014, B, 90
|Load distinct Key,rangesum(Residual,0)||as||Residual|
DROP Table RESIDENT_TOTAL_STAGE1;
Thank you, Prem. This method definitely works but would you know how to put this in an expression instead of the script? I eventually want to chart this and the running total will be dynamic depending on which keys the user selects.