Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a bar chart displaying two variables, Foreign Sales and Domestic Sales that I draw one next to the other per product.
I am trying to have each one in different color and i tried the following under Colors and legend, Colors custom, By expression:
if('Foreign Sales', red() ,if('Domestic Sales', green()))
But the above did not work. Any suggestion how to fix this code please?
Thanks very much.
by variables; you mean measures? u have 2 measures?
you can use RGB() fucntion with IF clause. mention rgb values from any color format window.
e.g If(Sales>10, RGB(245,24,18), rgb(45,7,9)
use this in TeXT Color under the your expression
if(getselectedcount(Foreign Sales)=1,Green(),red())
Above would give red color if Foreign Sales is selected or with no selection it would stay red color.
This will work only upon SELECTION in field.
It would be helpful if you tell us if it is a variable or measure or dimension?
Yes both Foreign Sales and Domestic Sales are measures. thanks for the help.
What version of Qlik Sense are u using? (please answer rapidly, I'm not staying long..)
Qlik Sense 3.2 SF5
Well if It's june, september, or november 2017 (maybe even 3.2..., I've forgotten..);
Create ur 2 measures as master measures:
when u use these new master measures; u'll find them colored as u want:
And please think about upgrading to the last version (Qlik Sense November 2017)
Thanks Madhur. but i dont have any other condition on my two variables (foreign sales and domestic sales) other than i want them in two different colors. No such condition as sales >10.
ubt
I have tried this If(Sales, RGB(245,24,18), rgb(45,7,9)) but it did not work.