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: 
yuvi
Contributor
Contributor

AND operator in calculated field

I'm trying to write a conditional using AND to create a calculated field in my table but getting a syntax error saying missing right parenthesis.  

This is what I have:

If(floor(EndDate)-floor(OrderDate)>30 and floor(endDate)-floor(OrderDate)<=60, floor(EndDate)-floor(OrderDate),0)

 

For context: the calculated field will output aging analysis for orders with 30-60 days from the cutoff date. So if the difference in endDate and orderDate is between 30-60, it will calculate the number of days it has from 30. So diff of 34 would be 4. 

Labels (1)
1 Reply
BrunPierre
Partner - Master
Partner - Master

Hi, this is what I would do.

If(Interval(Floor(EndDate) - Floor(OrderDate), 'D') > 30 and Interval(Floor(EndDate) - Floor(OrderDate), 'D') <= 60, Interval(Floor(EndDate) - Floor(OrderDate), 'D'), 0)