Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

joeybird
Contributor II

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
Contributor II

Re: range and colour select

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

17 Replies
kangaroomac
Contributor II

Re: range and colour select

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
Contributor II

Re: range and colour select

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
Contributor II

Re: range and colour select

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
Contributor II

Re: range and colour select


that's fab!

thank you x

Kind Regards

Joeybird

joeybird
Contributor II

Re: range and colour select

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
Contributor II

Re: range and colour select

Hi Joeybird,

Would an AND work?

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

joeybird
Contributor II

Re: range and colour select

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
Contributor II

Re: range and colour select

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
Contributor II

Re: range and colour select

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