Qlik Community

Qlik Sense App Development

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

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

3 Replies
sarvesh
Contributor III

Re: Qlik sense Colors with Condition

Try like this:

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

Employee
Employee

Re: Qlik sense Colors with Condition

Hi Pankaj,

Try

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

Cheers,

Patrik.

Not applicable

Re: Qlik sense Colors with Condition

Thanks Pratik ,it works for me

Cheers

Community Browser