Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 Date | Actual Delivery Date | Performance |
---|---|---|
01/01/2018 | 10/01/2018 | |
20/01/2018 | 10/01/2018 | |
30/01/2018 | 15/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.
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;
Hi,
you want to create the field performance on the model or just use it as an expression in a chart ?
Hi Youssef,
I would like to populate the field in the data model.
Thanks
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;
PFA
Brilliant!
This has worked!
Thanks you all for your help!
Great, Can you mark "Correct Answer" of right response !!