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: 
subbareddykm
Creator II
Creator II

Color Issue

Hi All ,

I have some KPI's that have some range for background color. I m not able to achieve it.

For each KPI i have different range for color, that too in feature also it may change or may not change.

How to automate those background color can any one suggest me .

Pleasse find attached app for ref.

11 Replies
subbareddykm
Creator II
Creator II
Author

is there any chance to get this?

ahaahaaha
Partner - Master
Partner - Master

Hi,

An example is given in the attached file.

The color code fragment (for the first two KPI)

If([KPI Name]= 'KPI 1' And Value>=90, Green(),

If([KPI Name]= 'KPI 1' And (Value>=70 And Value<90), Yellow(),

If([KPI Name]= 'KPI 1' And Value<70, RGB(250,100,100),

If([KPI Name]= 'KPI 3' And Value>=86, Green(),

If([KPI Name]= 'KPI 3' And (Value>=84.3 And Value<86), Yellow(),

If([KPI Name]= 'KPI 3' And Value<84.3, RGB(250,100,100),

...

))))))

Regards,

Andrey

subbareddykm
Creator II
Creator II
Author

This is not as i want , i already mentioned there my range is not fixed.

I need to automate this.

I have one solution but don't know to how do this,

Can i create start range for every KPI for Each color.

Example : KPI 1 Green range is 90 to 100,yellow 70 to 90  and red 0 to 69

I hope u understand it.

ahaahaaha
Partner - Master
Partner - Master

You change the value of Value and reload the data. Does not the color change?

avinashelite

Create variables for each range like

vGreen

=90

vYellow

=70

vRED

=0

Then if(values>vGreen,green(),

if(values>vYellow,yellow(),

f(values>vRED,RED(),

)))

subbareddykm
Creator II
Creator II
Author

Range is not fixed for each kpi is may change,

if u see the range for each KPI, it is different .

As per Ur suggestion if i store value in it, after few day , i may change.

subbareddykm
Creator II
Creator II
Author

Your suggestion will work,if value chages and range is fixed,

But in my case range will change and value will also will change.

jonathandienst
Partner - Champion III
Partner - Champion III

Andrey is on the right track. Set the background color expression for Value:

If([KPI Name] = 'KPI 1',

  If(Value > 90, Green(90),

  If(Value > 70, Yellow(), Red(90))),

If([KPI Name] = 'KPI 3',

  If(Value >= 86, Green(90),

  If(Value > 84.3, Yellow(), Red(90)))

// and so on for the remaining KPIs

))

I have done the first two for you. Use the same logic and add the remaining conditions. For the expression above, you will get:

Capture.PNG

PS - I added opacity to Green and Red so the numbers are visible. You could use LightRed() and LightGreen() instead.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
subbareddykm
Creator II
Creator II
Author

Hi,

Jonathan,

Its not working,

Lets take one example,If my KPI 1 is in future like below

 

>=60% green 40-69% yellow <40% red

If i use like above expression ,will not work right.