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

Expression for Calculating 1st occurrence date

Hi All,

what is expression for calculating no of days between 2 dates.

I have 2 date fields 'start date ','end date' , i need to calculate the 1 occurred date of 'start date ' and last occurred date of 'end date' .

Thank you all

10 Replies
ecolomer
Master II
Master II

simply have the difference between both dates

Not applicable
Author

I didn't get you...

robert_mika
Master III
Master III

Does that mean that you have multiple start and end days?

anbu1984
Master III
Master III

=Interval(EndDt-StartDt,'d')


=Interval(Date#('1/1/2015','M/D/YYYY')-Date#('1/1/2014','M/D/YYYY'),'d')

Not applicable
Author

Exactly Robert..

posted here i didn't get any reply there..

Calculating Delay between 2 dates

its_anandrjs

Hi,

If you are asking for date difference try one of this

([end date] - [start date]) as Diff,

Interval ([end date] - [start date],'d') as Diff,

Regards

Anand

its_anandrjs

Hi,

It seems your date are text so then try to convert them in Date format then try Interval or date difference

Ex:-

Interval ([end date] - [start date],'d') as Diff,

Or

//Without converting you can use this way.

Interval( Date(Date#([end date],'MM/DD/YYYY'),'MM/DD/YYYY') - Date(Date#([start date],'MM/DD/YYYY'),'MM/DD/YYYY'),'d') as Diff,

Regards

Anand

Not applicable
Author

It is fine but i have multiple dates , i need to calculate only 1 date from multiple dates,i.e greater date than creation date.

Not applicable
Author

Further clear understanding of requirement  i created sample data.

1.1st Occurrence date of Forecast date and Last Occurrence date of Event Date and both should be Greater than Creation Date.

2. Decision should be Pass.

3. Also should calculate if Forecast Date of the Stage should be greater than previous pass Event Date

Example - While calculating Phase 2 Col 12 Forecast date is Greater than Col 9 Event date and it is passed at Phase 1 on 10/7/2014

                      

S.noIDNameStageForecast DateEvent DateDecisionCreation DateDelay In No of Days
161PVPhase 19/12/20149/1/2014
261PVPhase 110/5/20149/1/2014
361PVPhase 110/9/20139/1/2014
461PVPhase 111/13/20149/1/2014
561PVPhase 110/3/20149/1/2014
661PVPhase 19/3/2014Pass9/1/2014
761PVPhase 19/3/2014Cancelled9/1/2014
861PVPhase 110/7/2014Pass9/1/2014
961PVPhase 110/7/2014Pass9/1/201425
1061PVPhase 210/10/20149/1/2014
1161PVPhase 210/5/20149/1/2014
1261PVPhase 210/10/20149/1/2014
1361PVPhase 210/8/20149/1/2014
1461PVPhase 29/10/20149/1/2014
1561PVPhase 210/9/20149/1/2014
1661PVPhase 210/7/2014Pass9/1/2014
1761PVPhase 211/11/2014Pass9/1/2014
1861PVPhase 211/17/2014Pass9/1/201438