Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

How to Flag only sat and sunday ?

Hi All

I have a date field , and i want to use script reload to create a flag_weekday field. Hope some one will advise me.

I mean when i activated the flag it will select all data from monday till friday.

How to do it ?

Paul

1 Solution

Accepted Solutions
Highlighted
MVP
MVP

Re: How to Flag only sat and sunday ?

Create a new field like: Weekday(Date) as Weekday, you would find there are no dates with sun/sat. Hence, the flag is so.

View solution in original post

7 Replies
Highlighted
Not applicable

Re: How to Flag only sat and sunday ?

Hi All

Enclosed my QV Doc.

The reasons is i want to check who never come to work to during weekday.

Paul

Highlighted
MVP
MVP

Re: How to Flag only sat and sunday ?

This?

Load

          If(Weekday(Date)='Sat' Or Weekday(Date)='Sun' , 'Week End') as Flag

Highlighted
Not applicable

Re: Re: How to Flag only sat and sunday ?

Hi Tres

I try it does not work , it return blank. enclosed my raw data.+ QV doc.

Hope you can take a look.

Paul

Highlighted
Partner
Partner

Re: How to Flag only sat and sunday ?

Paul,

Try creating a field with WEEKDAY(Date) as WeekDay

Then you can select only working days, working almost like a flag.

Or you can use the expression above bu tresesco, but with the numeric value (text one will vary depending on your operational system language).

it becomes

If(Weekday(Date)>=5,'Week End') as Flag

Regards,

D'Agosto

Highlighted
MVP
MVP

Re: How to Flag only sat and sunday ?

Create a new field like: Weekday(Date) as Weekday, you would find there are no dates with sun/sat. Hence, the flag is so.

View solution in original post

Highlighted
Specialist
Specialist

Re: How to Flag only sat and sunday ?

Hi,

I'd first create a variable weekday through the ='WeekDay(date field)' function. This will give you a number from 1 to 7 in the variable weekday.

Then you can create the flag afterwards like 'if (weekday <> 6 and weekday <> 7, 'WEEK', 'WE')as Flag '.

Highlighted
Not applicable

Re: How to Flag only sat and sunday ?

Hi All

Thank you very much , i understand the concept now , i need partial reload , since weekday field is not created.

Paul