Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
lawrance
Creator II
Creator 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
Champion III
Champion III

Check here: Change accordingly. Like below:

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

How to identify first sunday in a month

View solution in original post

4 Replies
lawrance
Creator II
Creator II
Author

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
Specialist II
Specialist II

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
Creator II
Creator II
Author

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
Champion III
Champion III

Check here: Change accordingly. Like below:

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

How to identify first sunday in a month