I want to create a master calendar from today to maxdate as per requirement .Below the code i am using ....but its not showing right week filter ...kindly suggest
LET vToday = Num(Today());
Min([Arrival Date]) as MinDate,
Max([Arrival Date]) as MaxDate
//Let varMinDate = Num(Peek('MinDate',0,’MinMax’));
//Let varMinDate = Num(Peek($(vToday)));
Let varMaxDate = Num(Peek('MaxDate',0,’MinMax’));
$(vToday) + Iterno() -1 as Num,
Date($(vToday) + Iterno() -1) as TempDate
Autogenerate 1 while $(vToday) + Iterno() -1 <= $(varMaxDate);
TempDate As [Arrival Date],
Week(TempDate) As Week,
weekday(TempDate) as WeekDay,
Year(TempDate) As Year,
Month(TempDate) As Month
Order by TempDate ASC;
drop table TempCalendar;
Try the below master calender
let vMinDate = num(MakeDate(2014,04,01));
let vMaxDate = floor(Today());
let vDateToday = num(today());
//************** Temp Calender ******************//
$(vMinDate) + rowno() - 1 as DateNumber,
date($(vMinDate) + RowNo() - 1) as Date
$(vMaxDate) - $(vMinDate) + 1;
load (Date) as Date,
Date(Date,'DD/MM/YYYY') as DATE,
Year(Date) as Year,
Month(Date) as Month,
day(Date) as Day,
Week(Date) as Week,
'Q' & (ceil(WildMatch(month(Date),'Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec','Jan','Feb','Mar')/3)) as Quarter
Resident TempCalender where exists(Date);
drop table TempCalender;
Hope it helps you!!
Just describing my scenerio.....
I want to filter out the data according to Today's date till max date.
suppose today is 12th august 2015 and i have data till jan 2016.
so my first week should be week comes in date 12th august and vice versa till jan 2016.
i think my requirement is clear for every one .