Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I imported an excel table (column 1: month, column 2: sales) and wanted to know if there was a way to conditional color based on the previous month's sales figure (for example: if previous month sales is less than current month sales, green, otherwise red).
I'm using:
A Qlick Sense KPI's Text colour can be set by function.
In your example you can simply set the function as following:
If( sum({<Month={'$(=Num(max(Month)))'} >sum({<Month={'$(=Num(max(Month)-1))'},rgb(0,255,0),rgb(255,0,0))
However, this solution will create a problem on January, since this is the first month and you would like to compare it to December.
You could instead define a new Dimension within the Script editor which sets continuous numbers for every month/year.
For example, 12.2018 would be 1, 01.2019 would be 2, 02.2019 would be 3 and so on and replace Month in the above described set analysis
with the new Dimension.
Best Regards Julian