Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Company | Transaction date | Transaktio_ distributed |
Company x | 1.1.2015 | 1 |
Company x | 1.2.2015 | 1 |
Company x | 1.3.2015 | 1 |
Company x | 1.4.2015 | 1 |
Company y | 1.1.2015 | 1 |
Company y | 1.2.2015 | 1 |
Company y | 1.3.2015 | 1 |
Company y | 1.4.2015 | 1 |
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?
Was able to figure it out
(Aggr(RangeSum(Above(Sum(Transaktio_capital_called), 0, RowNo())), Company, (Hvuosi, (Numeric))))
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):
Date | Customer | Sales |
03.03.2019 | a | 23 |
05.08.2019 | b | 34 |
23.06.2019 | a | 45 |
01.01.2019 | b | 56 |
27.09.2019 | a | 12 |
09.12.2019 | b | 89 |
06.05.2019 | a | 45 |
12.02.2019 | b | 67 |
08.04.2019 | a | 23 |
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:
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!