
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to get previous month first and last date?
Hi,
I would like to limit data that is imported into QlikView and for that we have a XML function that needs startdate=YYYYMMDD and enddate=YYYYMMDD set up.
I can currently change it manually to the first day of the previous month and to the last day of the previous month or take it from a variable. But as people accesing template over web cannot change variable, then reload is using date set there before.
Is there an function to add previous month first date and last date in format YYYYMMDD?
For example today it would give me 20120701 and 20120731.
In September it would give me 20120801 and 20120831?
Thank you in advance for any help!
Mariliis
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
=date(floor(monthstart(addmonths(Today(),-1))), 'YYYYMMDD')
and
=date(floor(monthend(addmonths(Today(),-1))), 'YYYYMMDD')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
=date(floor(monthstart(addmonths(Today(),-1))), 'YYYYMMDD')
and
=date(floor(monthend(addmonths(Today(),-1))), 'YYYYMMDD')

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you!
These functions work excactly as I need

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
date(monthstart(Today(), -1),'YYYYMMDD')
