Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community,
I'm facing one issue.
this is my script using for calendar......
Calendar Script:
FactTable:
Load * Inline [
Date
2014-01-01
];
Temp: //Using the fact to extract min and max date
LOAD MIN(Date) as minDate,
Today() as maxDate
Resident FactTable;
LET vMinDate = Num(Peek('minDate', 0, 'Temp'));
LET vMaxDate = Num(Peek('maxDate', 0, 'Temp'));
DROP Tables Temp, FactTable;
TempCalendar:
LOAD
$(vMinDate) + IterNo() - 1 as Num,
Date($(vMinDate) + IterNo() - 1) as TempDate
AutoGenerate
1 While $(vMinDate) + IterNo() -1 <= $(vMaxDate);
MasterCalendar:
LOAD
TempDate as OrderDate,
Week(TempDate) as Week,
Year(TempDate) as Year,
Month(TempDate) as Month,
Day(TempDate) as Day,
Weekday(TempDate) as WeekDay,
'Q' & ceil(month(TempDate) / 3) as Quarter,
'Q' & Ceil(Month(TempDate)/3) & '-' & Year(TempDate) as QuarterYear,
MonthName(TempDate) as MonthYear,
Week(TempDate)&'-'&Year(TempDate) as WeekYear
Resident TempCalendar
Order By TempDate ASC;
DROP Table TempCalendar;
Here, 2017 year, maximum week showing 52, how come??
Maximum week should be 39...
if i click 52 week also i.e associating to 01-01-2017
Did i anything wrong ??, Please let me know.
Thanks in Advance.....
FYI I've added this to refine and correct values
SET FirstWeekDay=6;
Actually i saw this post, but i didn't notice..
Thank you
Nice Solution... !!
You can flag suitable answer as correct and numerous helpful ...