Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rajeshqvd
Creator II
Creator 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

 

1 Solution

Accepted Solutions
sunny_talwar

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)))

 

View solution in original post

8 Replies
sunny_talwar

Front end or back end?

rajeshqvd
Creator II
Creator II
Author

In Front end Sunny, Thank you

sunny_talwar

Try this expression

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

 image.png

rajeshqvd
Creator II
Creator II
Author

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
];

sunny_talwar

What is the needed output?

rajeshqvd
Creator II
Creator II
Author

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
sunny_talwar

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
Creator II
Creator II
Author

Working perfectly Thank you sooo much Sunny 😀