Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Partner - Creator III
Partner - Creator III

Yes,

in your script

LOAD

     weekday(CalendarDate) as WeekDay

From Table1;

Then, you can use in your expression

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

View solution in original post

4 Replies
yduval75
Partner - Creator III
Partner - Creator III

Yes,

in your script

LOAD

     weekday(CalendarDate) as WeekDay

From Table1;

Then, you can use in your expression

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

MK_QSL
MVP
MVP

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
Author

Thanks Yoann, i adpated that and it worked perfectly!

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

MK_QSL
MVP
MVP

For your information..

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

so no 7...