Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to report how many trucks in my dataset arrived on time. All trucks that arrive within half an hour after their booked time (Delivery Due Time), or on time. To do this, I added the following line to my script:
If([Vehicle arrival Time]-[Delivery DueTime]<=(1/48), 1,0) as [On time]
If a truck is half an hour late (1/48 hour), it is still on time. That's why i put <= 1/48 in my script. However, when the truck arrives exactly half an hour later than their booked time, Qlikview still regards them as late (it gives them a "0" as value). Can anybody explain this/help me with this issue?
Thanks
Hi
I tried the suggestions with the Round(..) formula, but it didn't work either. Eventually, I changed 1/48 to 31/1440. That solved the problem.
Thanks for your help
Best regards,
Niek
Maybe some rounding problem, try rounding to nearest minute
If(round([Vehicle arrival Time]-[Delivery DueTime],1/(24*60))<=(1/48), 1,0) as [On time]
Please attach sample qvw.
-Nilesh
Hi
I would try and take the floating point comparison out completely, like this
If(Round(([Vehicle arrival Time]-[Delivery DueTime]) * 48) <= 1, ...)
HTH
Jonathan
Or
If(Round(([Vehicle arrival Time]-[Delivery DueTime]) * 24, 0.1) <= 0.5, ...)
Hi
I tried the suggestions with the Round(..) formula, but it didn't work either. Eventually, I changed 1/48 to 31/1440. That solved the problem.
Thanks for your help
Best regards,
Niek