Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
joeybird
Creator III
Creator III

range and colour select

Hiya

wild card question - Qlik Sense

is it possible that when you use a kpi box, that when you select it a desired section, it will change background or text colour depending on your selection

e.g

target range is <70% any column selected that value is more than 70 % the text or background will change from black to red

the same question then applies to a bar chart  - Jan - Dec

that month columns will be green for within range..... and some month columns will be red to show over the range

Please help

Kind Regards

joeybird

1 Solution

Accepted Solutions
kangaroomac
Partner - Creator II
Partner - Creator II

Hi Joanna,

For a bar chart, you could add your logic as an expression in Appearance -> Colours and legend -> Untick Auto and Choose By Expression from the drop down. 

The KPI Object does not seem to have as many options for appearance yet (done using V 1.01).

Test Colours.png

View solution in original post

17 Replies
kangaroomac
Partner - Creator II
Partner - Creator II

Hi Joanna,

For a bar chart, you could add your logic as an expression in Appearance -> Colours and legend -> Untick Auto and Choose By Expression from the drop down. 

The KPI Object does not seem to have as many options for appearance yet (done using V 1.01).

Test Colours.png

joeybird
Creator III
Creator III
Author

That's great for a bar graph thank you

can you please send me an example line  of an expression text, to use

as easier for me to work out logic how done, and then can amend for my requirements.

Kind Regards

Joeybird 

kangaroomac
Partner - Creator II
Partner - Creator II

The expression I used in the example above is: IF([Region Name] = 'International', Green(), Blue())

In your case you'll probably use something similar to: IF((Sum(Numerator) / Sum(Denominator)) > 0.7, Red(), Black())

joeybird
Creator III
Creator III
Author


that's fab!

thank you x

Kind Regards

Joeybird

joeybird
Creator III
Creator III
Author

Hiya

I don't know if you can help a little further

I have used your code successfully as below

IF(((TargetValue)) < (Target), Red(), Green())

however I would like to change the < part

as some selections need to be > e.g 50%

I have another column that in SQL represents GT (greater than) or LT (less than)

Is there a way of altering the code that if LT is selected then it knows proceed with the calculation?

Kind Regards

Joeybird

kangaroomac
Partner - Creator II
Partner - Creator II

Hi Joeybird,

Would an AND work?

i.e. IF((([TargetValue])) < ([Target]) AND [Selector] = 'LT', Red(), Green())

joeybird
Creator III
Creator III
Author

Hiya

no because the < is still in the code

Is there a way please the selector column will hopefully represent this when a selection is made?

Kind Regards

Joeybird

kangaroomac
Partner - Creator II
Partner - Creator II

You got me confused.

If you type in pseudo code what you want I may be able to assist.

i.e. IF This Then

          That

     Else

          Something Else

joeybird
Creator III
Creator III
Author

Hiya

want to write something like

IF((([TargetValue]) AND [TargetComparator] = 'LT'([Target]) , Red(), Green())

or write something like

IF((([TargetValue]) AND [TargetComparator] = 'LT'([Target]) , Red(), Green())

then else ((([TargetValue]) AND [TargetComparator] = 'GT'([Target]) , Red(), Green())

Kind Regards

Joeybird