Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
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
tresesco
MVP
MVP

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
Not applicable
Author

Hi All

Enclosed my QV Doc.

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

Paul

tresesco
MVP
MVP

This?

Load

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

Not applicable
Author

Hi Tres

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

Hope you can take a look.

Paul

fernandotoledo
Partner
Partner

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

tresesco
MVP
MVP

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

puttemans
Specialist
Specialist

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 '.

Not applicable
Author

Hi All

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

Paul