Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Magnus
Contributor
Contributor

Calculate number of delays

I have 2 different dates that are connected to a certain ShipmentID.

PromisedDeliveryDate and DeliveredEventDate.

How would I go about calculating how many shipments that are delyed in a certain time-period (last month for example)?  

1 Solution

Accepted Solutions
pradosh_thakur
Master II
Master II

count({<ShipmentID={"=PromisedDeliveryDate <DeliveredEventDate"}>+<PromisedDeliveryDate={">=$(=monthstart(today()-30)) <=$(=monthend(today()-30))"}>}ShipmentID)

Something similar to above.

Creating a flag in the backend might be a good idea and optimize the expression

Try if(PromisedDeliveryDate < DeliveredEventDate,1,0) as delay_flag

 

the use that so that there will be one less calculation

Learning never stops.

View solution in original post

2 Replies
pradosh_thakur
Master II
Master II

count({<ShipmentID={"=PromisedDeliveryDate <DeliveredEventDate"}>+<PromisedDeliveryDate={">=$(=monthstart(today()-30)) <=$(=monthend(today()-30))"}>}ShipmentID)

Something similar to above.

Creating a flag in the backend might be a good idea and optimize the expression

Try if(PromisedDeliveryDate < DeliveredEventDate,1,0) as delay_flag

 

the use that so that there will be one less calculation

Learning never stops.
Magnus
Contributor
Contributor
Author

thanks!