Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

nihhalmca
Valued Contributor 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
New Contributor III

Re: Making one month Calendar with Fridays only

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
Honored Contributor III

Re: Making one month Calendar with Fridays only

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

MVP & Luminary
MVP & Luminary

Re: Making one month Calendar with Fridays only

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.

Highlighted
nihhalmca
Valued Contributor II

Re: Making one month Calendar with Fridays only

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

=

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

nihhalmca
Valued Contributor II

Re: Making one month Calendar with Fridays only

Hi Jagan Mohan,

Can you say for total year

for example fridays in months for total year

Regards,

Nihhal.

MVP & Luminary
MVP & Luminary

Re: Making one month Calendar with Fridays only

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
Honored Contributor

Re: Making one month Calendar with Fridays only

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
New Contributor III

Re: Making one month Calendar with Fridays only

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

nihhalmca
Valued Contributor II

Re: Making one month Calendar with Fridays only

Thank You Sravan

NiHhal.