Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there fellow Qlik Sense enthousiasts,
In the attached qvd I've created a small setup of what I'm trying to achieve.
Which is the following.
I have added an inline table with transactions with an amount linked to a date.
The transactions can be positive or negative amounts.
The cumulative sum is plotted in a line chart.
And the color of the line is set by expression:
=If(RangeSum(Above(Sum(Amount),0,RowNo())) < 0
, rgb(255, 0, 0)
, rgb(48, 122, 66)
)
So far pretty straight forward.
To manipulate the cumulative sum for the amounts per month I've added a variable input field.
When you put in a particular amount a second line is created to plot the "Amount + Additional amount" with expression: RangeSum(Above(Sum(Amount),0,RowNo())) + $(vAdditionalAmount)
As you can see the two lines are colored the same way.
I've tried numerous things to get each line to color individually red or green when it's below or above the zero marker line.
On the forum I found all sorts of solutions for coloring measurements, but unfortunately I can't get it to work.
Here is another post which asks a similar question, but hasn't been answered yet:
Color Line Chart by Segmented Colors in Master Mea... - Qlik Community - 1595241
Does anyone have an idea how to achieve this?
Please feel free to fiddle with the attached qvd and upload your adjustments.
Thanks in advance for your time and efforts!!
Kind regards,
Sebb.
Hi there,
An update on my progressions.
I managed to color the lines individually, but only if I set the second measure "Amount + Additional" as an alternative measure.
By setting the following expression in the "Colors and legend" setting:
=If(GetObjectMeasure()='Amount' and [Amount] < 0
, rgb(255, 0, 0)
, If(GetObjectMeasure()='Amount + Additional' and [Amount + Additional] < 0
, rgb(255, 0, 0)
, rgb(48, 122, 66)
)
)
Please have a look at the attached QVF.
When I drag the alternative measure back to the list of measures the expression doesn't color the individual lines.
So there must be some other way to make it work to have both measures in the same line chart, but individually colored...😉
Thanks again!
Kind regards,
Sebb