Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
rajeshqvd
Contributor II

show cumulative sum

in put

Month YearSales
Jul-1923
Jun-1944
May-19444
Apr-1911
Mar-1985
Feb-1948
Jan-19949
Dec-1848

 

Required Output:

Month YearSalesOutput
Jul-19231652
Jun-19441629
May-194441585
Apr-19111141
Mar-19851130
Feb-19481045
Jan-19949997
Dec-184848

 

Labels (1)
1 Solution

Accepted Solutions

Re: show cumulative sum

I am not sure why Sum(Sales) is doubled, but you can try this 🙂

Aggr(RangeSum(Above(Sum(TOTAL <[Month Year]> Sales), 0, RowNo())), ID, ([Month Year], (NUMERIC)))

If that was by error, then try this

Aggr(RangeSum(Above(Sum(Sales), 0, RowNo())), ID, ([Month Year], (NUMERIC)))

 

8 Replies

Re: show cumulative sum

Front end or back end?

rajeshqvd
Contributor II

Re: show cumulative sum

In Front end Sunny, Thank you

Re: show cumulative sum

Try this expression

Aggr(RangeSum(Above(Sum(Sales), 0, RowNo())), ([Month Year], (NUMERIC)))

 image.png

rajeshqvd
Contributor II

Re: show cumulative sum

Hi Sunny Thanks for your response if add ID its not working please help me on this

Table:
LOAD ID,Date(Date#([Month Year], 'MMM-YY'), 'MMM-YY') as [Month Year],
Sales;
LOAD * INLINE [
ID, Month Year, Sales
1, Jul-19, 23
1, Jun-19, 44
1, May-19, 444
1, Apr-19, 11
1, Mar-19, 85
1, Feb-19, 48
1, Jan-19, 949
1, Dec-18, 48
2, Jul-19, 23
2, Jun-19, 44
2, May-19, 444
2, Apr-19, 11
2, Mar-19, 85
2, Feb-19, 48
2, Jan-19, 949
2, Dec-18, 48
];

Re: show cumulative sum

What is the needed output?

rajeshqvd
Contributor II

Re: show cumulative sum

same output but need ID &  [Month Year] aggrigation

IDMonth YearSum(Sales)Aggr(RangeSum(Above(Sum(Sales), 0, RowNo())), ([Month Year],(NUMERIC)))
1Jul-19463304
1Jun-19883258
1May-198883170
1Apr-19222282
1Mar-191702260
1Feb-19962090
1Jan-1918981994
1Dec-189696
2Jul-19463304
2Jun-19883258
2May-198883170
2Apr-19222282
2Mar-191702260
2Feb-19962090
2Jan-1918981994
2Dec-189696

Re: show cumulative sum

I am not sure why Sum(Sales) is doubled, but you can try this 🙂

Aggr(RangeSum(Above(Sum(TOTAL <[Month Year]> Sales), 0, RowNo())), ID, ([Month Year], (NUMERIC)))

If that was by error, then try this

Aggr(RangeSum(Above(Sum(Sales), 0, RowNo())), ID, ([Month Year], (NUMERIC)))

 

rajeshqvd
Contributor II

Re: show cumulative sum

Working perfectly Thank you sooo much Sunny 😀