

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Month end function
Hi,
can anyone please make me understand how month end function works??
i was checking in help and example was mention like
monthend(4,'2001-07-19')
and output is '2001-08-31' how???
please explain..not able to understand
- Tags:
- new_to_qlikview
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What you wrote above is incorrect , ignore
Monthend('the_date',0) which will give u the last date of this month
Monthend('the_date',1) which will give u the last date of the following month
Monthend('the_date',-1) which will give u the last date of the previous month
Some examples
monthend ( '2001-02-19' ) returns '2001-02-28' with an underlying
numeric value corresponding to '2001-02-28 23:59:59.999'
monthend ( '2001-02-19', -1 ) returns '2001-01-31' with an underlying
numeric value corresponding to '2001-01-31 23:59:59.999'


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
monthend() returns the last date(of the month) of the target date.
if you do monthend() on today which is 19 May, it will return the last day of May.
The best way to understand functions is to actually use them.
try in a text box:
=monthend(today()) result is 31/05/2015


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In help explains: Returns a value corresponding to a timestamp with the last millisecond of the last date of the month containing date.
Monthend( '2001-02-19' ) returns '2001-02-28'
Instead '2001-02-19' you can use your Date field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What you wrote above is incorrect , ignore
Monthend('the_date',0) which will give u the last date of this month
Monthend('the_date',1) which will give u the last date of the following month
Monthend('the_date',-1) which will give u the last date of the previous month
Some examples
monthend ( '2001-02-19' ) returns '2001-02-28' with an underlying
numeric value corresponding to '2001-02-28 23:59:59.999'
monthend ( '2001-02-19', -1 ) returns '2001-01-31' with an underlying
numeric value corresponding to '2001-01-31 23:59:59.999'


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Yusuf,
in the same way could you pls help to understand following functions-
MonthsName,
Monthsstart,
e.g. monthsstart ( 4, '2001-10-19', 0, 2 ) returns '2001-10-01' with an underlying numeric value corresponding to '2001-10-01 00:00:00.000'
not able to understand this example.
kindly revert

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Abhay,
Monthstart is same as month end.
monthstart(2001-10-19) returns first day of month 2001-10-01.
