Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 AndreasGu
		
			AndreasGu
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		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()) MayilVahanan
		
			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())
 MayilVahanan
		
			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())
 AndreasGu
		
			AndreasGu
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thank you. That sorted it.
