Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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)?
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
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
thanks!