Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ShipDate Vs DueDate

Hello Folks,

Your helps are always appreciated!

I need to count the number of products delivered

On-Time:         Shipment Date – Due Date <= 0

Late:                Shipment Date – Due Date > 0


I have used the below set analysis for delivery on time but it is not working as expected.

=count( {$< [ProductID] = {">=$(=Date(ShipDate))<=$(=Date(DueDate))"} >} [ProductID] )

Kindly let me know

Kiru

2 Replies
jerem1234
Specialist II
Specialist II

Set Analysis is only calculated once per chart, and not for each row or for each record. Therefore you can't have the DueDate and Shipment Date change for each record in set analysis. Try an if statement like:

count(If(date(ShipDate)<=date(DueDate), [ProductID]))

and for Late:

count(If(date(DueDate)<date(ShipDate), [ProductID]))

You may want to add distinct in there as well.

Hope this helps!

hic
Former Employee
Former Employee

I would define a field in the script already:

     ShipDate - DueDate as DelayInDays,

Then you can do whatever you want using this in Set Analysis

HIC