Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Author

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

View solution in original post

7 Replies
Chanty4u
MVP
MVP

try

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

sunny_talwar

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

Not applicable
Author

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

Not applicable
Author

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

Not applicable
Author

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
Author

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
Author

HIii

Thank you so much

I got it

its working now