Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
tamilarasu
Champion
Champion

Master Calendar With Existing Field

animated-hello-smiley-emoticon.gif

I have a field name "Date' in my source data. I want to create a master calendar (data island) by using this field.

Can anyone give me the load script for this requirement please. Attached sample data.


thank-you-smiley-300x189.gif

1 Solution

Accepted Solutions
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this script

Data:

LOAD DISTINCT

Date(Floor(Date)) AS Date

FROM

[Date.xlsx]

(ooxml, embedded labels, table is Sheet1);

CalendarMaster:

LOAD

    Date(Date) AS Date,

    Year(Date) AS Year,

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

    Month(Date) As Month,

    Day(Date) As Day,

    Week(Date) As Week;

Load Date(MinDate + IterNo() -1 ) AS Date While (MinDate + IterNo() - 1) <= Num(MaxDate);

Load

    Min(Date) AS MinDate,

    Max(Date) AS MaxDate

RESIDENT Data;

Regards,

Jagan.

View solution in original post

2 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this script

Data:

LOAD DISTINCT

Date(Floor(Date)) AS Date

FROM

[Date.xlsx]

(ooxml, embedded labels, table is Sheet1);

CalendarMaster:

LOAD

    Date(Date) AS Date,

    Year(Date) AS Year,

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

    Month(Date) As Month,

    Day(Date) As Day,

    Week(Date) As Week;

Load Date(MinDate + IterNo() -1 ) AS Date While (MinDate + IterNo() - 1) <= Num(MaxDate);

Load

    Min(Date) AS MinDate,

    Max(Date) AS MaxDate

RESIDENT Data;

Regards,

Jagan.

tamilarasu
Champion
Champion
Author

Hi Jagan,

Thanks for the solution and it's working as expected. greatday2-6cb9b3ed120bf71f5d54ae89e8e6ff44.gif