Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

create flag for working days and weekends?

hi to all  i am new in qlikview

can any one clarify me flag creating for working days and weekends.for ur handy i am sharing here "master calender qvd" file

1 Solution

Accepted Solutions
rubenmarin

Hi Maruthi,

From the qvd i flagged weekend like this:

LOAD *,

     If(WeekDay(Date)>=5, 1, 0) as _IsWeekend

     If(WeekDay(Date)<5, 1, 0) as _IsWorkingDay // Not really needed as you can ask for _IsWeekend=0

FROM [.\Master_Calender.qvd] (qvd);

WeekDay may change from different countries, in mine, 5 are for saturday and 6 for sunday, change it according to your configuration.

Maybe you'll need a table that identifies local or national parties to flag as non-working days.

View solution in original post

4 Replies
rubenmarin

Hi Maruthi,

From the qvd i flagged weekend like this:

LOAD *,

     If(WeekDay(Date)>=5, 1, 0) as _IsWeekend

     If(WeekDay(Date)<5, 1, 0) as _IsWorkingDay // Not really needed as you can ask for _IsWeekend=0

FROM [.\Master_Calender.qvd] (qvd);

WeekDay may change from different countries, in mine, 5 are for saturday and 6 for sunday, change it according to your configuration.

Maybe you'll need a table that identifies local or national parties to flag as non-working days.

datanibbler
Champion
Champion

Hi maruthi,

that's quite easy. You have the WEEKDAY() function in QlikView (when you look that up in the Help_file, you'll get a list of all time- and date-functions, unfortunately all on one page) - that will, if I remember correctly, return a number. Depending on your system, weekends will be 1 and 7 or 6 and 7 - counting from Mon or from Sun.

Just use that in an IF_function to create a binary field with a 1 for weekdays and 0 for weekends.

HTH

Best regards,

DataNibbler

Not applicable
Author

Thank u Ruben

       i am very much satisfied by ur answer ...

Not applicable
Author

Thank DataNibbler