Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
tyagishaila
Specialist
Specialist

get date

Hi All,

i  have startdate(Today's date) and enddate(30 days before from today)

how can I get all dates between startdate and enddate without using database date field.

1 Solution

Accepted Solutions
Not applicable

Hi,

make Use of autogenerate

Ex:

Let vMinDate = Peek('MinDate',-1,'Date') - 1;

Let vMaxDate = Peek('MaxDate',-1,'Date');

Date:

Load Min(Date) as MinDate,

          Max(Date) as MaxDate

resident YourdateFieldSource;

Calendar:

Load Date(recno()+$(vMinDate)) as Date

Autogenerate vMaxDate - vMinDate;

View solution in original post

6 Replies
Not applicable

Hi,

make Use of autogenerate

Ex:

Let vMinDate = Peek('MinDate',-1,'Date') - 1;

Let vMaxDate = Peek('MaxDate',-1,'Date');

Date:

Load Min(Date) as MinDate,

          Max(Date) as MaxDate

resident YourdateFieldSource;

Calendar:

Load Date(recno()+$(vMinDate)) as Date

Autogenerate vMaxDate - vMinDate;

sujeetsingh
Master III
Master III

You can create master calender concept as Harsh has mentioned

Not applicable

hi,

QuartersMap: 

MAPPING LOAD  

rowno() as Month, 

'Q' & Ceil (rowno()/3) as Quarter 

AUTOGENERATE (12); 

// 

//Temp: 

//LOAD * INLINE [

//    minDate, maxDate

//    01/01/2014, 31/03/2015

//];

 

 

Let varMinDate = 41640;//Num(Peek('minDate', 0, 'Temp')); 

Let varMaxDate = num(today());//Num(Peek('maxDate', 0, 'Temp')); 

//DROP Table Temp; 

 

TempCalendar: 

LOAD 

               $(varMinDate) + Iterno()-1 As Num, 

               Date($(varMinDate) + IterNo() - 1) as TempDate 

               AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate); 

 

MasterCalendar: 

Load 

               TempDate AS OrderDate, 

               week(TempDate) As Week, 

               Year(TempDate) As Year, 

               Month(TempDate) As Month, 

               Day(TempDate) As Day, 

               YeartoDate(TempDate)*-1 as CurYTDFlag, 

               YeartoDate(TempDate,-1)*-1 as LastYTDFlag, 

               inyear(TempDate, Monthstart($(varMaxDate)),-1) as RC12, 

               date(monthstart(TempDate), 'MMM-YYYY') as MonthYear, 

               ApplyMap('QuartersMap', month(TempDate), Null()) as Quarter, 

               Week(weekstart(TempDate)) & '-' & WeekYear(TempDate) as WeekYear, 

               WeekDay(TempDate) as WeekDay 

Resident TempCalendar 

Order By TempDate ASC; 

Drop Table TempCalendar; 

Regards

Vimlesh

Not applicable

Hi,

anbu1984
Master III
Master III

Load *,Date([StartDate]+IterNo()) While IterNo() <= Interval([EndDate]-[StartDate],'D');

Load ID,Date#([StartDate],'MM/DD/YYYY') As [StartDate],

Date#([EndDate],'MM/DD/YYYY') As [EndDate] Inline [

ID,StartDate,EndDate

1,11/24/2014,01/21/2015

2,03/22/2015,5/10/2015

3,01/30/2015,02/28/2015 ];

Not applicable

Hi shaila,


For Alternate way,


PFA,