Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Apologies for earlier post, I've managed to distill down the issue significantly.
As you can see in the data table below, using this expression below, I've managed to calculate the cumulative sum of the n5_value_EUR relative to the n0_marketcap_group - so both market caps add up to 1 at the end of their respective clock (up to 1).
So this works in the table viz.
RangeSum(Above( Sum(n5_value_EUR), 0, RowNo()))
/
Sum( TOTAL <n0_marketcap_group> n5_value_EUR )Trying to put this same measure in a line chart, it breaks, and doesnt actually accumulate across the dimensions.
Any thoughts on how to do this on a line chart ?
@johnnyjohn
Try using aggr() with your field ordering
aggr(
RangeSum(
above(
Sum(n5_value_EUR)
/
sum( total <n0_marketcap_group> n5_value_EUR),0,RowNo())),
(n0_marketcap_group,(=Sum(n5_value_EUR),Desc)),Clock)
Hello, thanks for the suggestion, no luck with the expression unfortunately. Below is a simple sample dataset, just in case it helps you create the expression for the line graph.
On a line chart, Group=Clock (continuous axis), Line=n0_marketcap_group, Height Of Line= the expression that makes this relative cumulative sum per market cap.
Many thanks
+-------------+------------------+----------------+
|n5_value_EUR |n0_marketcap_group| Clock |
+-------------+------------------+----------------+
| 5082 | Mid | 0.00 |
| 1436 | Mid | 0.03 |
| 1286 | Mid | 0.23 |
| 2275 | Mid | 0.23 |
| 1483 | Mid | 0.54 |
| 1755 | Mid | 0.54 |
| 1628 | Mid | 1.00 |
| 39759 | Small | 0.00 |
| 1904 | Small | 0.50 |
| 364 | Small | 0.50 |
| 3683 | Small | 0.50 |
| 1281 | Small | 0.53 |
| 618 | Small | 1.00 |
+-------------+------------------+----------------+