Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
JoseGarcia
Creator III
Creator III

Colour expression

Hi there, 
Want to make a look ahead condition if greater than today, red, green.

Using formula: 

=If(Month(Avg([EightD.D1_KPIDate])+241) > Month(Today()), RGB(0,255,0), RGB(255,0,0))

But I am getting this result (Dec2023 should be red)
any ideas? Thank you

JoseGarcia_0-1709655894836.png

 

Labels (1)
1 Solution

Accepted Solutions
JoseGarcia
Creator III
Creator III
Author

Hi there, 
This expression worked!

IF(Avg([EightD.D1_KPIDate]+241> today()), RGB(25,170,110), RGB(220,50,35) )

JoseGarcia_0-1709728482822.png

 

View solution in original post

3 Replies
PhanThanhSon
Creator
Creator

Hey,

Your condition needs to be adjusted based on the dimension and not on your measure, as you're considering the dimension. In other words, in clear terms:

IF(DateDim > today(), RGB(0,255,0), RGB(255,0,0))

If your dimension is not of type CalendarType, you would need to cast your calendar:

Date(Date#(DateDim, 'MMM YYYY'), 'MMM YYYY') 

Where DateDim is your dimension.

Best regards Son

JoseGarcia
Creator III
Creator III
Author

Hi there, 
tried both expressions, no luck 😞

IF([EightD.D1_KPIDate]+241> today(), RGB(0,255,0), RGB(255,0,0))JoseGarcia_0-1709704907870.png

if(Date(Date#(EightD.D1_KPIDate, 'MMM YYYY'), 'MMM YYYY')+241 > today(), RGB(0,255,0), RGB(255,0,0))
JoseGarcia_0-1709704907870.png

JoseGarcia
Creator III
Creator III
Author

Hi there, 
This expression worked!

IF(Avg([EightD.D1_KPIDate]+241> today()), RGB(25,170,110), RGB(220,50,35) )

JoseGarcia_0-1709728482822.png