Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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
MVP
MVP

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

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

5 Replies

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

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

MVP
MVP

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

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

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

=MonthEnd(MakeDate(Year,Month))

Or

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

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

Try

=Date(Floor(MonthEnd(DateField)))

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

Thanks,

Celambarasan

Not applicable

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

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

Community Browser