Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ghassanaldalati
Contributor III
Contributor III

first and Last Date from Date selction Rand

please Help:

I select Month Rang from  ( Feb to Aug ) on month field.   And Year Rang From ( 2012 to 2015 ) in Year field

now I want to show first and last date from chosen  range as:

First date : 01/02/2012

Last Date : 31/08/2015

Number Of days between first and last date = 1260 days

1 Solution

Accepted Solutions
t_moutault
Contributor III
Contributor III

Hi Ghassan,

Try this

FirstDate = makedate(Min(Year),Min(Month),1)

LastDate = MonthEnd( makedate(Max(Year),Max(Month),1) )

Number of Days = interval(LastDate-FirstDate, 'D')

View solution in original post

7 Replies
sunny_talwar

May be like this:

First Date - Min(Date)

Last Date - Max(Date)

Number of Days - Max(Date) - Min(Date)

Gysbert_Wassenaar

Or perhaps Number of Days: Max(Date) - Min(Date) + 1


talk is cheap, supply exceeds demand
ghassanaldalati
Contributor III
Contributor III
Author

I try ...... not working 

Not ( maybe ) and not ( perhaps )

any one have ( Sure correct answer )

sunny_talwar

Wow that's a very confusing response. What are you trying to say? Can you provide a sample?

t_moutault
Contributor III
Contributor III

Hi Ghassan,

Try this

FirstDate = makedate(Min(Year),Min(Month),1)

LastDate = MonthEnd( makedate(Max(Year),Max(Month),1) )

Number of Days = interval(LastDate-FirstDate, 'D')

ghassanaldalati
Contributor III
Contributor III
Author

Dear Thomas Moutault ................ Great correct answer --- Thank you

Dear Sunny.............................Sorry for my confusing response .. I apologize ..Thank you

oknotsen
Master III
Master III

If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post).

May you live in interesting times!