Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Conditional coloring

Hi,

I wish to add conditional coloring in my profile but it isn't working

I have two measures in my KPI and I want one measure to be red when it is less than the other measure and if it is greater than it should appear as green.

I am using this code.

if((Avg([Option Trd Cnt15 nnn]) < Avg([Option Trd Cnt14 nnn])), red(), green())

Kindly help

1 Solution

Accepted Solutions
Not applicable

Re: Conditional coloring

Hi,

Please describe which Qlik Sense object do you use?

If you are using KPI object you don't need to add IF statement. In properties tab of object under "Data" you should have for example Avg([Option Trd Cnt15 nnn]) measure. You need to open it and turn "Conditional colors" ON. You can "Add limit" and write expression. It will be enough if you will add second measure Avg([Option Trd Cnt14 nnn]) as proper limitation and set correct colors.


The color of first measure should change depending on second measure value for current selection.

BR,

Milosz

7 Replies
sureshqv
Esteemed Contributor III

Re: Conditional coloring

try

=if(Avg[Option Trd Cnt15 nnn]),if(Avg( [Option Trd Cnt14 nnn])Red(),Green())

MVP
MVP

Re: Conditional coloring

This looks like it should work. Is Option Trd Cnt15 nnn a field name, right?

Not applicable

Re: Conditional coloring

No, this doesn't work...expression error

Not applicable

Re: Conditional coloring

its a measure....a column name in the excel sheet

Not applicable

Re: Conditional coloring

Hi,

Please describe which Qlik Sense object do you use?

If you are using KPI object you don't need to add IF statement. In properties tab of object under "Data" you should have for example Avg([Option Trd Cnt15 nnn]) measure. You need to open it and turn "Conditional colors" ON. You can "Add limit" and write expression. It will be enough if you will add second measure Avg([Option Trd Cnt14 nnn]) as proper limitation and set correct colors.


The color of first measure should change depending on second measure value for current selection.

BR,

Milosz

Not applicable

Re: Conditional coloring

Hi I am using a KPI.

I tried without if statement as well

Avg([Option Trd Cnt15 nnn]) < Avg([Option Trd Cnt14 nnn])

I tried this but it did not work

Not applicable

Re: Conditional coloring

HIii

Thank you so much

I got it

its working now