Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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;
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;
You can create master calender concept as Harsh has mentioned
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
Hi,
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 ];
Hi shaila,
For Alternate way,
PFA,