Qlik Community

Qlik Sense App Development

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

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
andrew_sell
New Contributor II

Cumulative Line Graph - QlikSense

Good Afternoon,

I am looking for an expression to create a cumulative line graph based on the following data example.

Month               Total Savings

Jan-2017          100000

Feb-2017          25000

March-2017      12500

April-2017          10000

In this example, I would want the line point to be 100000 for Jan, 125000 for Feb, 137500 for March and 147500 for April.

Thinking this might be simple, but i am having trouble accomplishing it.

1 Solution

Accepted Solutions
onur0707
Contributor

Re: Cumulative Line Graph - QlikSense

Hi Andrew,

add your Month values as dimension and for the measure use:

aggr(rangesum( above( sum([Total Savings]),0,rowno())),Month)


after appropriate sorting your line chart will look like below. I think below is what you want.

forum.png

regards,

O.Y

4 Replies
tomasz_tru
Valued Contributor

Re: Cumulative Line Graph - QlikSense

rangesum( above( sum([Expression1]),0,rowno()))

onur0707
Contributor

Re: Cumulative Line Graph - QlikSense

Hi Andrew,

add your Month values as dimension and for the measure use:

aggr(rangesum( above( sum([Total Savings]),0,rowno())),Month)


after appropriate sorting your line chart will look like below. I think below is what you want.

forum.png

regards,

O.Y

omodoshouses
New Contributor

Re: Cumulative Line Graph - QlikSense

Hi and sorry for posting in this conversation but I believe you can help me out. I had the same issue and the solution you have provided helped me out. However, I still have an issue with the x-axis. My case is that the y-axis is the revenue while the x-axis is the number of nights (I am running a hotel). So lets say, I have a total revenue of 30000 and a total nights of 500 (so average revenue per night is 60), then I want to create a linear graph were the values would be shown as follows:

Nights   Revenue 

50         ->     3000

100       ->    6000

......

leading to 500 Nights and 30000. I have managed to aggregate the revenue using the expressions you have already posted, however, I am having an issue with the aggregation of the duration. Also note that I have a variable of duration, which calculates the duration of every single reservation added in the spreadsheet.

 

Thanks a lot

omodoshouses
New Contributor

Re: Cumulative Line Graph - QlikSense

Hi and sorry for posting in this conversation but I believe you can help me out. I had the same issue and the solution you have provided helped me out. However, I still have an issue with the x-axis. My case is that the y-axis is the revenue while the x-axis is the number of nights (I am running a hotel). So lets say, I have a total revenue of 30000 and a total nights of 500 (so average revenue per night is 60), then I want to create a linear graph were the values would be shown as follows:

Nights   Revenue 

50         ->     3000

100       ->    6000

......

leading to 500 Nights and 30000. I have managed to aggregate the revenue using the expressions you have already posted, however, I am having an issue with the aggregation of the duration. Also note that I have a variable of duration, which calculates the duration of every single reservation added in the spreadsheet.

 

Thanks a lot
Community Browser