Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Create an expression for calculating On Time In Full

Hi,

I have done my first simple QW report to measure Delivery Performance for my Suppliers. As a first attempt I did a simple if expression that compared confirmed date with Good receit date. This works fine and looks as follows:

 

If

((ConfirmedDate-GRdate) >0, 0, 1) as DP,

Basically this will mean that all early deliveries will be measured as on time. I would now like to alter that expression so that it provides an On Time measure with no tolerance for early deliveries. My attempt was as follows:

 

If

((ConfirmedDate-GRdate) >0, 0, 1
OR
IF((ConfirmedDate-GRdate) <0, 0, 1)) as DP,

  

I have obviously done something stupid... Could you give me advice on how to correct or maybe give me an alternative solution?

As an extension to this I would also like to add an expression that also take into account the quantity delivered. I would like to do it with an expression containing AND as follows:

Kind regards

Henrik

1 Solution

Accepted Solutions
michael123
Partner - Creator
Partner - Creator

With  no fault tolerence you can do something like this.

1: If ((ConfirmedDate-GRdate)=0, 1) as DP,

2: If ((ConfirmedDate-GRdate)=0 AND (GRquantity - OrderQuantity=0), 1) as DP,

View solution in original post

4 Replies
Not applicable
Author

... the AND expression I had in mind was:

AND(GRquantity=OrderQuantity)

Thanks

michael123
Partner - Creator
Partner - Creator

With  no fault tolerence you can do something like this.

1: If ((ConfirmedDate-GRdate)=0, 1) as DP,

2: If ((ConfirmedDate-GRdate)=0 AND (GRquantity - OrderQuantity=0), 1) as DP,

Not applicable
Author

Hello Michael,

Thank you. What if I wanted a tolerance, say +/- 1 day in the expression. Is there a function where I could use the absolute value, like in Excel: Abs(...)? Any other idea?

Thanks

Henrik

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

This will pass the deliveries in the tolerances defined by variables vDateTolerance and vQuantityTolerance:

If((Fabs(ConfirmedDate-GRdate) <= vDateTolerance)

And (Fabs(GRquantity - OrderQuantity) <= vQuantityTolerance), 1, 0) As DP

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein