#66 📈 Control dimensions values in Line chart for Qlik Sense
It’s been too much time from my last post at DailyQlikChallenge, it's not even a weekly anymore 😆
I will try to get back into my good habits and post more regularly.
Today, let's talk about our well known line chart.
I'm sure you've encountered this problem when you want to compare dimensions over time :
For Sure you don’t want your user to be visually assaulted with these too many lines.
That’s actually really a bad visualization!
It makes sense with fewer lines, but how to control it?
A common solution is to set up a calculation condition on this chart to force the user to reduce the number of dimensions.
I have used this solution myself, but I now see two problems with it:
It’s a massive loss of space, and a bad visual experience
You have to choose a number, like 7 in the picture on the left. But why 7 and not 6 or 5 ?
Let’s take it to the next level and let people see what they want
In this GIF, you can see that thanks to a slider, users can choose if they want to display all the line, or to cumulate them in only one.
Obviously he still can see a bad vizualisation, but it’s up to him!
How to build this in Qlik Sense ?
In short, create a variable vLineNumber a use it with the Variable Input object from Qlik Dashboard Bundle.
Set the value range from 1 to =count(distinct [Sub-Category])
Then, in the line chart, use this expression as a second dimension :
= if ($(=count(distinct [Sub-Category]))>$(vLineNumber),
'$(=count(distinct [Sub-Category])) Sub Categories',
[Sub-Category])
And Voilà !
Want to see it :