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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikBeginner1
Creator
Creator

Dates in between date

Hello,

Comparison between Series dates and Film dates, the Series dates need to be within the Film Dates

I have this requirement, I have individual film date records, but there are multiple transactions per record.

I have joined 

LEFT JOIN (VLFactTable)
LOAD

VLPolicyKey
VLPolicyNumber,
VLFilmPolicies,
VLBBNIPolicies,
Min(Date(Floor(VLFIlmEffectiveDate),'DD/MM/YYYY')) as VLFEffectiveDateMin,
Max(Date(Floor(VLFilmExpiryDate),'DD/MM/YYYY')) as VLFExpiryDateMax,
Resident VLFactTable
Group By
VLPolicyNumber,VLLTAPolicies,VLBBNIPolicies;


LEFT JOIN (VLFactTable)
LOAD

VLPolicyKey,

VLPolicyNumber,
Date(SeriesStartDate, 'DD/MM/YYYY') as VLSStartDate,
Date(SeriesEndDate, 'DD/MM/YYYY') as VLSEndDate,
FROM [lib://QVD/DTL\LongTermAgreement.QVD] (qvd)

 

I am just struggling with the flag on how to get this requirement correct. I currently have :

If(Date(VLFEffectiveDateMin,'DD/MM/YYYY') <= Date(VLSStartDate,'DD/MM/YYYY') AND Date(VLExpiryDateMax,'DD/MM/YYYY') >= Date(VLSEndDate,'DD/MM/YYYY'),1,0) AS VL03Flag,

 

Is there a different way to achieve what I am trying to achieve? It does not seem to work correctly 

 

Labels (2)
1 Reply
Digvijay_Singh

After your 2nd left join do you see all the 4 dates you need for your calculation, do you see them in single row? Whats your date format, can you share some sample data?