Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
BrunPierre
Partner - Master II
Partner - Master II

Cummulative amount by date selection

Hi guys!

I'd like to perform a cumulative sum by date preferably in the scripts.

In the table below column(1) has the raw values, whilst column(2) displays the cumulative figure.

Now upon selecting a date i.e. 12/10/2020 this expression "(RangeSum(Above(SUM({<%Date={"<=$(=MAX(%Date))"} >}m_InterestAccruals),0,RowNo())))" , sums up from 22/09/2020 to give a correct output of 258,655.08

peter_brown_2-1615436153221.png

My challenge is getting only this total figure of 258,655.08 just a single row each and each time a date is selected.

Sample data attached, thanks.

 

 

 

 

 

 

 

Labels (1)
1 Reply
MayilVahanan

HI @BrunPierre 

Try like below

Temp:
LOAD %ID,
%Date,
Amount
FROM
[dummy.xls]
(biff, embedded labels, table is Sheet1$)
Where %ID <> 'Total';

LOad *, If(%ID = Peek('%ID'), Amount+Peek('Cummulative'), Amount) as Cummulative Resident Temp Order by %ID, %Date;

DROP Table Temp;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.