
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Adding months to Date
Hi,
Is it possible within QlikView to add months to a date?
For example have this script:
set startDate = '01/01/2012'
set enddate = '01/04/2012'
let a=Interval(month(endDate)-month(startDate),'m');
for i = 0 to a;
let filename = Date(Date(startDate+i),'MM')&' '&Date(Date(startDate+i),'MMMM')&' '&YEAR(Date(startDate+i))&' - Data.xls';
the "startDate+i" is adding days. How do I add this to the month instead?
Any help would be greatly appreciated.
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Use AddMonths(startdate, n) where startdate is the date you wish to add to, n is the number of months (negative for prior months)
AddMonths('2012/05/25', 3) -> 2012/08/25
Regards
Jonathan


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, look at the function AddMonths().


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Use AddMonths(startdate, n) where startdate is the date you wish to add to, n is the number of months (negative for prior months)
AddMonths('2012/05/25', 3) -> 2012/08/25
Regards
Jonathan
