Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Exclude Saturday and Sunday

I have a simple expression which give me a line chart where the only dimenion is CalendarDate

COUNT (DISTINCT UserName)

Can I use a set analysis in this expression to excluded Saturdays and Sundays from the chart? If so, how?!

1 Solution

Accepted Solutions
yduval75
Contributor III

Re: Exclude Saturday and Sunday

Yes,

in your script

LOAD

     weekday(CalendarDate) as WeekDay

From Table1;

Then, you can use in your expression

COUNT ({<WeekDay-={6,7}>} DISTINCT UserName)

4 Replies
yduval75
Contributor III

Re: Exclude Saturday and Sunday

Yes,

in your script

LOAD

     weekday(CalendarDate) as WeekDay

From Table1;

Then, you can use in your expression

COUNT ({<WeekDay-={6,7}>} DISTINCT UserName)

Re: Exclude Saturday and Sunday

Create below line in your script...

IF(WeekDay(CalendarDate)=5 or WeekDay(CalendarDate)=6, 1,0) as WeekDayFlag

Now use as below..

COUNT ({<WeekDayFlag = {'0'}>}DISTINCT UserName)

Not applicable

Re: Exclude Saturday and Sunday

Thanks Yoann, i adpated that and it worked perfectly!

COUNT({$<CalendarDayName-={'Sat','Sun'}>} DISTINCT UserName)

Re: Exclude Saturday and Sunday

For your information..

weekday in qlikview starts from Monday as 0 and ends at Sunday as 6....

so no 7...

Community Browser