Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
nihhalmca
Specialist II
Specialist II

Making one month Calendar with Fridays only

Hi Experts,

I am facing one issue that i want to make calendar for one month with fridays only

For instance in Jul 2013 month, only these days 5,12,19,26 needs to display in calendar object.

Thanks in Advance,

Nihhal.

1 Solution

Accepted Solutions
sravan_v007
Partner - Contributor III
Partner - Contributor III

Use This Script...

let vMin=num(MakeDate(2011,01,01));

LET vMax=Num(Today());

Time:

LOAD

  Date($(vMin)+RowNo()-1,'DD/MM/YYYY') as Date

 

  AutoGenerate 1

 

  While $(vMin)+RowNo()<=$(vMax);

 

 

  Date:

  LOAD

            Date,

            WeekDay(Date) as Week,

            Month(Date) as Month,

            Year(Date) as Year,

   if(WeekDay(Date)='Mon', Date) as MondayDates,

            if(WeekDay(Date)='Fri', Date) as FridayDates

            Resident Time;  

 

DROP Table Time;

View solution in original post

8 Replies
sujeetsingh
Master III
Master III

Just place a iff expression to show only Week day="Fri"

jagan
Luminary Alumni
Luminary Alumni

Hi Nihhal,

In Load script arrive a new column like this

LOAD

     DateFieldName,

     If(WeekDay(DateFieldName) = 'Fri', Day(DateFieldName)) AS FridayDate

FROM DataSource;

Now use this new field.

Regards,

Jagan.

nihhalmca
Specialist II
Specialist II
Author

  Write this expresion in calendar object (Field) or edit script

=

=if(WeekDay(July)=4,July)  (4 as Friday)

nihhalmca
Specialist II
Specialist II
Author

Hi Jagan Mohan,

Can you say for total year

for example fridays in months for total year

Regards,

Nihhal.

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try like this

LOAD

     DateFieldName,

     If(WeekDay(DateFieldName) = 'Fri' AND Year(DateFieldName) = 2013, Day(DateFieldName)) AS FridayDate,

     If(WeekDay(DateFieldName) = 'Fri' AND Year(DateFieldName) = 2013, DateFieldName) AS FridayActualDate

FROM DataSource;

Hope this helps you.

Regards,

Jagan.

Sokkorn
Master
Master

Hi Nihhal,

Try below script:

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

Let varMinDate = Num(Date#('01-01-2013','dd-MM-yyyy'));

Let varMaxDate = Num(Date#('31-12-2013','dd-MM-yyyy'));

TempCalendar:

LOAD

               $(varMinDate) + Iterno()-1 As Num,

               Date($(varMinDate) + IterNo() - 1) as TempDate

               AutoGenerate 1 While $(varMinDate) + IterNo() -1 <= $(varMaxDate);

MasterCalendar:

Load

               TempDate     AS [Dates],

               WeekDay(TempDate)As [WeekDays]

               Year(TempDate)     As [Year],

               Month(TempDate)     As [Month]        

Resident TempCalendar Where WeekDay(TempDate)='Fri' Order By TempDate;

Drop Table TempCalendar;

Regards,

Sokkorn

sravan_v007
Partner - Contributor III
Partner - Contributor III

Use This Script...

let vMin=num(MakeDate(2011,01,01));

LET vMax=Num(Today());

Time:

LOAD

  Date($(vMin)+RowNo()-1,'DD/MM/YYYY') as Date

 

  AutoGenerate 1

 

  While $(vMin)+RowNo()<=$(vMax);

 

 

  Date:

  LOAD

            Date,

            WeekDay(Date) as Week,

            Month(Date) as Month,

            Year(Date) as Year,

   if(WeekDay(Date)='Mon', Date) as MondayDates,

            if(WeekDay(Date)='Fri', Date) as FridayDates

            Resident Time;  

 

DROP Table Time;

nihhalmca
Specialist II
Specialist II
Author

Thank You Sravan

NiHhal.