Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
AndreasGu
Contributor II
Contributor II

Color formating with date value

I'm quite new to Qlik and trying to understand how the if statements work together with date sets.

I have two date ranges. Last 7 days (day 1-7), and the previous 7 days (day 8-14).

So here I try to see which one is the higher, what amendments  needs to be made here?

if(sum({_Last7Days} #SALES) > sum({_LastPR7Days} #SALES) , green(), red())
Labels (1)
1 Solution

Accepted Solutions
MayilVahanan

Hi @AndreasGu 

I think, you have 2 flag field like _Last7Days & _LastPR7Days in your calendar. In that case, try like below

if(sum({<_Last7Days ={1}>} #SALES) > sum({<_LastPR7Days={1}>} #SALES) , green(), red())

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

2 Replies
MayilVahanan

Hi @AndreasGu 

I think, you have 2 flag field like _Last7Days & _LastPR7Days in your calendar. In that case, try like below

if(sum({<_Last7Days ={1}>} #SALES) > sum({<_LastPR7Days={1}>} #SALES) , green(), red())

 

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
AndreasGu
Contributor II
Contributor II
Author

Thank you. That sorted it.