Skip to main content
Announcements
Qlik Announces Qlik Talend Cloud and Qlik Answers: LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jblomqvist
Specialist
Specialist

Is it possible to create Pick and Match expression for a date range? (As an alternative to IF statements)

Hi all,

Is it possible to create a pick and match expression that is an alternative to a nested IF statement for different date ranges?

Example:

Let's say you had a DeliveryDate field.

And I wanted to create a criteria like this:

If DeliveryDate is less than <=5 days from OrderDate then it's Good

If DeliveryDate is between >=6 and <=10 days then it was Satisfactory

If Delivery Date is >=11 days then it is Late.

How can I write this in a Pick Match expression, if at all?

2 Replies
sunny_talwar

Just saw this thread today where somebody figured out a way to use Pick(Match()) instead of if for range

Pick Match with ‘greater/less than’ operators

MarcoWedel

Hi,

maybe one solution could be:

Pick(Match(-1,DeliveryDate-OrderDate<=5,DeliveryDate-OrderDate>=6 and DeliveryDate-OrderDate<=10,DeliveryDate-OrderDate>=11),'Good','Satisfactory','Late')

QlikCommunity_Thread_232390_Pic1.JPG

QlikCommunity_Thread_232390_Pic2.JPG

QlikCommunity_Thread_232390_Pic3.JPG

hope this helps

regards

Marco