Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Line chart, cumulative, multiple lines

Hi Community,

Im trying to display  cumulative value based on date for multiple companies in a line chart. Basically the idea is to display a cumulative line for each selected company, ie.  If I select 2 companies, it should draw a 2 lines, one for each company.

Heres what ive have done:

I have a table that has 3 columns.

CompanyTransaction dateTransaktio_ distributed
Company x1.1.20151
Company x1.2.20151
Company x1.3.20151
Company x1.4.20151
Company y1.1.20151
Company y1.2.20151
Company y1.3.20151
Company y1.4.20151

What Im doing, is displaying a linechart with Company and Transaction date as dimensions, and the following expression as a measure:  rangesum( above( total sum(Transaktio_distributed),0,1000)).


If I select only Company x, the data is correctly displayed. If I select both companies, the numbers get all messed up. 


What formula do I need to use for Transaction distributed for this to work?


3 Replies
Anonymous
Not applicable
Author

Was able to figure it out

(Aggr(RangeSum(Above(Sum(Transaktio_capital_called), 0, RowNo())), Company, (Hvuosi, (Numeric))))

TKi1
Contributor II
Contributor II

Hi!

Thanks for sharing your solution!

I had a similar problem and after some fiddling, I got it to work.

I've prepared some toy data to illustrate my problem (just the first 10 lines are displayed):

DateCustomerSales
03.03.2019a23
05.08.2019b34
23.06.2019a45
01.01.2019b56
27.09.2019a12
09.12.2019b89
06.05.2019a45
12.02.2019b67
08.04.2019a23

 

To get the cumulative distribution I used (similar to Jarkkotesi's solution):

 

Aggr(RangeSum(Above(Sum(Sales), 0, RowNo())), (Date, (NUMERIC, ASCENDING)))

 

 

The resulting line chart looks like this:

cumulative_multiline_ex.png

 

TKi1
Contributor II
Contributor II

Hi!

Unfortunately there is a mistake in the expression from my last post which wasn't too obvious to me at first. I think I got it now. The expression should be:

Aggr(RangeSum(Above(Sum(Sales), 0, RowNo())), (Customer), (Date, (NUMERIC, ASCENDING)))

 

Sorry for the confusion!