Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Highlighted
lawrance
Contributor II

Master Calendar - Year of First Weekend(Saturday)

Hi all,

How to generate the weekend(Saturday), year of first weekend(Saturday) in QlikView script Master Calendar.

Thanks,

Lawrance A

1 Solution

Accepted Solutions
vishsaggi
Esteemed Contributor III

Re: Master Calendar - Year of First Weekend(Saturday)

Check here: Change accordingly. Like below:

= Date(YearStart(Today()) + 6)

How to identify first sunday in a month

4 Replies
lawrance
Contributor II

Re: Master Calendar - Year of First Weekend(Saturday)

Hi all,

Could someone help to create the all weekend(saturday) and year of first weekend(Saturday).

Let me know if you need more details.

Thanks,

Lawrance A

vvira1316
Valued Contributor II

Re: Master Calendar - Year of First Weekend(Saturday)

Hi

Not sure if you are looking for following

LET Start = floor(YearStart(Date#('01/01/2017', 'MM/DD/YYYY')));
LET End = floor(YearEnd(Date#('01/01/2017', 'MM/DD/YYYY')));

LET NumOfDays = End - Start + 1;

Date_src:
LOAD
$(Start) + Rowno() - 1 as DateID
AUTOGENERATE $(NumOfDays);

[MasterCalendar]:
LOAD
DateID, // just in case
date(DateID) as CalDate, // it will be in format defined in your SET DateFormat=, or in your system format
day(DateID) as CalDay,
week(DateID) as CalWeek,
month(DateID) as CalMonth, // simple month name; it is dual - numeric and text
dual(month(DateID) & '-' & year(DateID),
year(DateID) & num(month(DateID), '00')) as CalMonthYear, // Month-Year format, dual
year(DateID) as CalYear,
WeekDay(DateID) as CalWeekday,
WeekEnd(DateID, 0, 5) as CalWeekEnd,
'Q' &
ceil(month(DateID)/3) as CalQuarter, // in format Q1, Q2, Q3, Q4
// dual('Q' & ceil(month(DateID)/3) & '-' & year(DateID)) as MonthQuarter,
year(DateID) & ceil(month(DateID)/3) as CalYearQtr // Qn-Year, dual
// and whatever else you may want here...
RESIDENT Date_src;
Drop Table Date_src;

You can tweak it as per your need.

Cal.PNG

Also, if you have found solution to this and other threads of your then please close them.

BR,

Vijay

lawrance
Contributor II

Re: Master Calendar - Year of First Weekend(Saturday)

Hi Vijay,

Thanks for your response.

I expecting the year of first weekend.

For Example,

Year: 2017

First Month: January

First Weekend(Saturday): 01/07/2017(MM/DD/YYYY)

Expected Output: 01/07/2017

Thanks,

Lawrance A

vishsaggi
Esteemed Contributor III

Re: Master Calendar - Year of First Weekend(Saturday)

Check here: Change accordingly. Like below:

= Date(YearStart(Today()) + 6)

How to identify first sunday in a month