Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
paulwalker
Creator III
Creator III

Calendar

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.....

13 Replies
Anil_Babu_Samineni

FYI I've added this to refine and correct values

SET FirstWeekDay=6;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
paulwalker
Creator III
Creator III
Author

Actually i saw this post, but i didn't notice..

Thank you

paulwalker
Creator III
Creator III
Author

Nice Solution... !!

Anil_Babu_Samineni

You can flag suitable answer as correct and numerous helpful ...

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful