Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

How to get the intervall between two dates

Hello,

i need the intervall between two dates.

Example:

First date = 9/2/2009

Second date = 11/20/2009

The result should be look like this: 9,10,11 or sep,oct,nov

Thank you for your time

Tags (2)
1 Solution

Accepted Solutions

How to get the intervall between two dates

Hello,

I'd use something like

LET vFirstDate = Num(Date('StartingDateHere'));LET vSecondDate = Num(Date('EndingDateHere'));TempCalendar:LOAD MakeDate(Year($(vFirstDate)), Month($(vFirstDate)), Day($(vFirstDate))) + Iterno() - 1 AS TempDate, Month(Date($(vFirstDate))) AS TempMonth, Day(Date($(vFirstDate))) AS TempDayAUTOGENERATE 1 WHILE $(vFirstDate) + Iterno() - 1 <= $(vSecondDate);
adding any other additional field you want to use (week, day of week, quarter...).

I'd suggest you to create a master calendar if you have not done it yet. There are several threads in the forum and blogs about how to do it. You can check here.

2 Replies

How to get the intervall between two dates

Hello,

I'd use something like

LET vFirstDate = Num(Date('StartingDateHere'));LET vSecondDate = Num(Date('EndingDateHere'));TempCalendar:LOAD MakeDate(Year($(vFirstDate)), Month($(vFirstDate)), Day($(vFirstDate))) + Iterno() - 1 AS TempDate, Month(Date($(vFirstDate))) AS TempMonth, Day(Date($(vFirstDate))) AS TempDayAUTOGENERATE 1 WHILE $(vFirstDate) + Iterno() - 1 <= $(vSecondDate);
adding any other additional field you want to use (week, day of week, quarter...).

I'd suggest you to create a master calendar if you have not done it yet. There are several threads in the forum and blogs about how to do it. You can check here.

Not applicable

AW:Re: How to get the intervall between two dates

Thank you for your fast response