Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Is there a way to assign a color per year? I am creating a report with year as the dimension. Out of all time periods in the data, I have only gotten the past 3 years using set analysis. As a result, the default colors in the graph were quite to be in a similar shade maybe because it considered the other years not included in the set analysis However, I want the colors as distinct as possible. Any suggestions?
You can create the Color code for each Year.
Goto Expression, click the + sign and select Background color and write your custom expression like below:
Pick(Match(Year_Field,2015,2014,2013),RGB()for 2015,RGB()for 2014,RGB()for 2013)
To make this a little more dynamic, I would create a variable
vVar = Max(Year_Field)
and then use it like this:
Pick(Match(Year_Field, $(vVar), ($(vVar) - 1), ($(vVar) - 2)), RGB() for 2015,RGB() for 2014,RGB() for 2013)
Would this work on Qlik Sense?
I haven't worked with variables in Qlik Sense, but I think the new version allows for you to work with variables. If variables can be used the expression should work.
Yes
cf. video - Qlik Sense Using Variables interface - for more details about variables in QS11.
Define vVar eg : 2016
In Appearance > Colors and legend > Colors Custom > By expression
Pick(Match(YEAR_FIELD,$(vVar),$(vVar)+1,$(vVar)+2),RGB(255,0,0),RGB(0,255,0),RGB(0,0,255))
Best regards,
L