Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

HELP! Complex expression assistance needed!

Hi All,

I am trying to calculate a value for an existing column called 'Performance' by using two dates. The requested date of delivery, and the actual date of delivery. If the line was delivered before the requested delivery date the value needs to list 'EARLY' . If the same day it needs to list 'ON TIME'. If the line was delivered after the requested delivery date the value needs to list 'LATE'.

Requested Delivery DateActual Delivery DatePerformance
01/01/201810/01/2018
20/01/201810/01/2018
30/01/201815/01/2018

This table is a perfect match to my data set, however I am struggling to write the expression that would populate the 'Performance' Column. Can anyone help?

Thank you for reading

Alex.

1 Solution

Accepted Solutions
Anil_Babu_Samineni

May be this?

Load  [Requested Delivery Date],

          [Actual Delivery Date],

          If([Requested Delivery Date] < [Actual Delivery Date], 'EARLY',

          If([Requested Delivery Date] < [Actual Delivery Date], 'On Time',

          If([Requested Delivery Date] > [Actual Delivery Date], 'LATE'))) as Performance

From Table;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

6 Replies
YoussefBelloum
Champion
Champion

Hi,

you want to create the field performance on the model or just use it as an expression in a chart ?

Anonymous
Not applicable
Author

Hi Youssef,

I would like to populate the field in the data model.

Thanks

Anil_Babu_Samineni

May be this?

Load  [Requested Delivery Date],

          [Actual Delivery Date],

          If([Requested Delivery Date] < [Actual Delivery Date], 'EARLY',

          If([Requested Delivery Date] < [Actual Delivery Date], 'On Time',

          If([Requested Delivery Date] > [Actual Delivery Date], 'LATE'))) as Performance

From Table;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
YoussefBelloum
Champion
Champion

PFA

Anonymous
Not applicable
Author

Brilliant!

This has worked!

Thanks you all for your help!

Anil_Babu_Samineni

Great, Can you mark "Correct Answer" of right response !!

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful