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

17 Replies
kangaroomac
Partner - Creator II
Partner - Creator II

What is contained in:

  • [TargetValue]
  • [TargetComparator]
  • and [Target]
joeybird
Creator III
Creator III
Author

Hiya

  • [TargetValue]  e.g 0.76   (80%)
  • [TargetComparator]  GT or LT ........In this case any TargetValue less than (LT) 0.80 then it needs to go red

note sometimes it needs to change to GT 50% for some targets

  • and [Target] e.g 0.80

Kind Regards

Joeybird

joeybird
Creator III
Creator III
Author

Hiya

top line needs to be just

[TargetValue]  e.g 0.76

Kind Regards

Joeybird

kangaroomac
Partner - Creator II
Partner - Creator II

I changed the fieldname [TargetValue] to [Value]


Maybe something like this would work?


IF((

     ([Value] < [Target] AND [TargetComparator] = 'LT') OR

          ([Value] > [Target] AND [TargetComparator] = 'GT))

               , Red(), Green())

joeybird
Creator III
Creator III
Author

Hiya

keeps coming up with error in expression

have changed field names

:+(

kangaroomac
Partner - Creator II
Partner - Creator II

Other than looking at the actual .qvf, only advise I can give you is try simplifying your expression.

i.e.

IF((

     ([Value] < [Target] AND [TargetComparator] = 'LT')

          // OR([Value] > [Target] AND [TargetComparator] = 'GT))

               , Red(), Green())

If you still get an error, comment out the AND part (being mindful of your brackets) until you find where the syntax error occurs.

joeybird
Creator III
Creator III
Author

Hiya

all working yeah thank you....

here is the code (just encase someone else requires) :+)

IF(([TargetValue] > [Target] AND [TargetComparator] = 'GT')

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

thank you xx

Kind Regards

Joeybird

joeybird
Creator III
Creator III
Author

Hiya

do you think you can apply the same technique please the formatting of the bar graph?

so it converts dynamically. if I created a new field to recognise format in percentage or number

use similar code below?

IF(([TargetValue] AND [Format] = 'Percentage')

OR ([TargetValue] AND [Format] = 'Number'), %(), Number())

kind Regards

Joeybird