Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everybody,
I've been using a solution when custom colouring measures in a bar chart (see "How to set custom colors by measures in a bar chart") which was created by this guy called Ian Wilson. It's been working just fine. However, now I'm trying to do the same thing with a line chart, but it doesnät work. It's s if the expression seems too complex or something. Take a look.
I have 2 dimensions; Month and Type. In the Type dimension I created a valueList to create temporary dimension and I wrote it like this: ValueList ('Result', 'Revenue PY', 'Budget').
MEASURE! The measure I have is called Amount and the expression I wrote is:
if(ValueList('Result','Revenue PY', 'Budget')='Result'
,Sum({1<%Restaurang=P(%Restaurang), [RR Grupp]={'Revenue PY'}, ÅrNum={'$(=Max(ÅrNum))'}, ÅrMånad={'<=$(=Max(ÅrMånad))'}>}Result)
,if(ValueList('Result','Revenue PY', 'Budget')='Revenue PY'
,Sum({1<%Restaurang=P(%Restaurang), [RR Grupp]={'Revenue PY'}, ÅrNum={'$(=Max(ÅrNum))'}, ÅrMånad={'<=$(=Max(ÅrMånad))'}>}Result)
,Sum({1<%Restaurang=P(%Restaurang), [RR Grupp]={'Revenue PY'}, ÅrNum={'$(=Max(ÅrNum))'}>}Budget)
)
)
In the appearance section i went to the coloring section and wrote the following expression:
if(ValueList('Result','Revenue PY','Budget')='Result'
,rgb(0,192,0)
,if(ValueList('Result','Revenue PY','Budget')='Revenue PY'
,rgb(0,0,192)
,rgb(192,0,0)
)
)
The colors only appear when the measure expressions aren't that complex. If I would've written this instead it works:
if(ValueList('Result','Revenue PY', 'Budget')='Result'
,Sum(Result)
,if(ValueList('Result','Revenue PY', 'Budget')='Revenue PY'
,Sum(Result)
,Sum(Budget)
)
)
Can someone help me understand how to make Ian Wilsons trick work on this? How can I make it work with my expression?
Sincerely,
Betty
Do the lines show with the automatic coloring enabled?
Can you post an example qlik sense app that illustrates the problem?
Okay, so I managed to kind of change the colours on the line chart, but I'm not fully satisfied. This is what the Line Chart looks like when it's with standard colours:
And this is what it looks with my customized colour:
As you can see, only the lines get the colours. I can live with that, but what's strange is that if I choose a month, all the other months look like this:
The other months and their lines get the same value as the "result" amount, which is weird. I've looked through the expressions, but they look fine. Is this something that sometimes can happen when trying to customize colours?
Sincerely,
Betty
Nevermind, I fixed the last problem (see the 3d picture). Maybe I shouldn't be that quick in writing, haha! The problem was in fact in the expression. There was somehthing missing.
However, there seems to be no way in colouring inbetween the lines. It looks quite boring with only coloured lines =/ Do you know if there is a way to achieve this? Maybe I've missed something.
Sincerely,
Betty
Hi Betty,
As in the thread below shows, this issue will be fixed in the next release.
G.
Okay, thank you! 😃