Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Explanation of Master Calendar

Hi,

I saw this code on the internet for the master calendar.

I used it in my application perfectly but I cannot fully understand the code.

Can someone give me a detailed explanation of the following code:

A:

LOAD

Date($(vMinDate) + IterNo()-1) as Date

AutoGenerate(1)

While($(vMinDate) + IterNo()-1) <= $(vMaxDate);

B:

LOAD

Date(Date) as Date,

Year(Date) as Year,

Month(Date) as Month,

Day(Date) as Day,

'Q' & Ceil(Month(Date)/3) as Quarter,

Year(Date)+ If (Month(Date) >= $(vFM),1,0) as fyear,

Mod(Month(Date) -$(vFM),12)+1 as fmonth,

if(Day(Date)>=1 and Day(Date)<=7,'Wk1',

  if(Day(Date)>7 and Day(Date)<=14,'Wk2',

  if(Day(Date)>14 and Day(Date)<=21,'Wk3',

  if(Day(Date)>21 and Day(Date)<=28,'Wk4', 'Wk5')))) as Week

Resident A;

DROP  Table A;

Thanks

0 Replies