Skip to main content
Announcements
The way to achieve your own success is the willingness to help somebody else. Go for it!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlik sense Colors with Condition

Hi Experts,

I have following table :

​  Name   Value

A23
B30
C45
D55
E15

I want value to be colored based on Condition .

My condition is if value is greater than avg(value) ,it should be red else Green.

I have manually used average value in following expression : if ((value) > 30 ,Red(),Green())    ---- output : 45 and 55 are red others are green

I also tried with if ((value) > Avg(value) ,Red(),Green())   ---It is giving all values as Green color .

I want to calculate expression dynamically (avg value),

Please help

Thanks & Regards,

Pankaj Bhalekar

Labels (1)
3 Replies
sarvesh
Creator III
Creator III

Try like this:

If(Sum(Sales)>30,Green(),If(Sum(Sales)<=30,Red()))

Patrik_Lundblad
Employee
Employee

Hi Pankaj,

Try

if(avg(Value) > avg(Total aggr(avg(Value), Name)), Red(), Green())

Cheers,

Patrik.

Not applicable
Author

Thanks Pratik ,it works for me

Cheers