Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Chris272727
Partner - Contributor
Partner - Contributor

Cumulative Sum in the bar char

Hello Everyone,

Below is my sample data and expected output is if i select  last 2 days, in the bar graph , it should show Load values as 86915,88665 in the Y -axis. I know how to get last 2 days, but couldnt able to get cumulative sum if i use 

RangeSum(Above(Sum(Records), 0, RowNo()))

as it shows 1710, 3460 for the last 2 days.

DateLoadCumulative Sum
5/22/20211425014250
5/23/20211429028540
5/24/20211433042870
5/25/20211437057240
5/21/202048057720
5/22/202052058240
6/12/2020131059550
6/13/2020135060900
6/14/2020139062290
6/15/2020143063720
8/31/2020441068130
9/1/2020445072580
9/2/2020459077170
9/3/2020463081800
6/20/2020170083500
6/21/2020170585205
6/22/2020171086915
6/23/2020175088665

 

Please provide the solution if possible

Thanks

Chris

1 Solution

Accepted Solutions
Gui_Approbato
Partner - Creator III
Partner - Creator III

Use an Aggr function with set analysis to lock the Date field:

 

Aggr( {<Date>}

RangeSum(Above(Sum(Records), 0, RowNo())),

Date)

 

View solution in original post

4 Replies
jwjackso
Specialist III
Specialist III

RangeSum(Sum(Records), Above(Sum(Records)), RowNo()))

Chris272727
Partner - Contributor
Partner - Contributor
Author

Not getting expect output if i select last 4 days with above formula

 

Chris272727_0-1591385994963.png

Modified Sample Data

DATELoadCumulative Sum
5/21/2020480480
5/22/20205201000
6/12/202013102310
6/13/202013503660
6/14/202013905050
6/15/202014306480
8/31/2020441010890
9/1/2020445015340
9/2/2020459019930
9/3/2020463024560
5/22/20211425038810
5/23/20211429053100
5/24/20211433067430
5/25/20211437081800
6/20/2021170083500
6/21/2021170585205
6/22/2021171086915
6/23/2021175088665
Gui_Approbato
Partner - Creator III
Partner - Creator III

Use an Aggr function with set analysis to lock the Date field:

 

Aggr( {<Date>}

RangeSum(Above(Sum(Records), 0, RowNo())),

Date)

 

Chris272727
Partner - Contributor
Partner - Contributor
Author

Thanks Above Solution works.  I have couple of question where i would need help.

Question#1

Below is my Sample Data. I would like to show last 3 days in a chart and cumulative sum of TUTStatus which i can get it. I am able to show last 3 days if dates are continuous. 

DateTUTStatus
5/17/2020Completed
5/20/2020Completed
5/23/2020Completed
5/25/2020Completed
5/28/2020Completed

 

Question #2

I would like to show TUTEstimatedDate vs TUTActualCompletionDate in a line chart graph. Attached sample line chart

 

 

TUTEstimatedDateTUTStatusTUTActualCompletionDate
5/17/2020Completed5/18/2020
5/20/2020Completed5/21/2020
5/23/2020Completed5/23/2020
5/25/2020Completed5/27/2020
5/28/2020Completed5/30/2020

 

Thanks for everything.

Chris