Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
SarahFenton
Contributor
Contributor

Conditional Formatting within a KPI Chart

Hi 

I'm relatively new to Qlik Sense and am using the desktop version.  I've used a KPI chart to show the latest months info and to also add the month on month / year on year variance as part of the second measure (see picture)Qlik Screenshot.PNG

I am having trouble adding conditional formatting to the 2nd measure - ie I want it to be red if less than 0 and green if not.

The current expression for the 2nd measure is:

num(($(V.Last Month Net Sales Value)-$(V.One Before Last Month Net Sales))/$(V.One Before Last Month Net Sales),'#.#%')

& '/' &

num(($(V.Last Month Net Sales Value)-$(V.Last Month Last Year Net Sales Value))/$(V.Last Month Last Year Net Sales Value),'#.#%') 

but I can't seem to add any conditional colours to it that work.

Any suggestions welcome! Smiley Happy

Thanks

Sarah

Labels (3)
5 Replies
pradosh_thakur
Master II
Master II

try below

KPI-> Appearance -> color ->second -> add limit -> do your formatting
Learning never stops.
SarahFenton
Contributor
Contributor
Author

Hi Pradosh

I tried that, but it comes up with a message saying 'Unable to change the properties because there is an error in the expression'.

I think its as I have 2 calculations within the second measure (effectively trying to create a third measure) so was looking for an alternative solution if possible.

Thanks

Sarah

pradosh_thakur
Master II
Master II

tried this in simple kpi

entered the value 10 in secondary expression

KPI-> Appearance -> color ->second -> check the color as red -> check conditional colors -> add limit -> click on the right side color -> change it to green-> add 0 in the expression box -> done

now chnage value to less than 0 and it will turn red.

Tried it, it's working.

Learning never stops.
SarahFenton
Contributor
Contributor
Author

Hi Pradosh

I've got it to work too for a simple calculation and have done so on a previous tab within my dashboard.  What I want, though, is to have the text within the 2nd measure change colour depending on their value.

eg First Measure = £20M, Second Measures = -0.9% MoM in Red and potentially +0.5% YoY in Green.

Am I getting the error as the way I have currently written it turns it into a text format by adding the & '/' & within the expression?  If so, is there a better way of writing it?

Thanks

Sarah

pradosh_thakur
Master II
Master II

Oh .. I see.. Getting the same error. I tried using the master measure as well but seems to be not working as well.
Learning never stops.