Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

For a month and year selected how do I select the last day?

Hi everyone,

In an  expression I would like to use the date of the last day of the month and year that I have selected eg would like 31st May 2014 in date format  as predetermined by QlikView script if I select May in its listbox and 2014 in its listbox or 31st August 2011 if I pick August and 2011 etc.

Help would be appreciated

1 Solution

Accepted Solutions
maxgro
MVP
MVP

=date(floor(MonthEnd( makedate(Year, Month) )))

View solution in original post

5 Replies
ashfaq_haseeb
Champion III
Champion III

Try

=MonthEnd(today()) to get month end

=YearEnd(today()) to get year end.

Replace today() with month(max(YourDateField)) and year(max(YourDateField)) accordingly as required.

And can format the date as you like.

Regards

ASHFAQ

maxgro
MVP
MVP

=date(floor(MonthEnd( makedate(Year, Month) )))

MK_QSL
MVP
MVP

=MonthEnd(MakeDate(Year,Month))

Or

=Date(MonthEnd(MakeDate(CalYear,NumMonth)),'DD MMMM YYYY')

CELAMBARASAN
Partner - Champion
Partner - Champion

Try

=Date(Floor(MonthEnd(DateField)))

Where DateField is the field name, which holds date values in your data model.

Thanks,

Celambarasan

Not applicable
Author

Thank you everyone for getting back to me so soon. Your replies have been helpful