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: 
Mdjenkins
Contributor II
Contributor II

Set Analysis Expression to count based on DayName

Good afternoon guys,  

I have a data model that contains the following:

CallID      Date

1               4/1/2019   (Monday)

2               4/2/2019   (Tuesday)

3               4/3/2019   (Wednesday)

4               4/4/2019   (Thursday)

5               4/5/2019   (Friday)

6               4/6/2019  (Saturday)

7               4/7/2019  (Sunday)

 

Now I want to do a count of CallID where the DayName of Date is either a Saturday or a Sunday.

So the answer would be 2 because CallID 6 and 7 match the criteria.

 

Does anyone know how I would do a set analysis expression on a Count function to only include Saturday and Sunday? 

Labels (3)
1 Solution

Accepted Solutions
sunny_talwar

May be this

Count({<Date = {"=Match(WeekDay(Date), 'Sat', 'Sun')"}>}CallID)

View solution in original post

4 Replies
Anil_Babu_Samineni

My suggested to go and create weekday field lokee Weekday(Date) as weekday Then, expression should be

Count({<weekday={'sat','sun'>} CallerID)

Else, use expression like

Count({<Date={"=match(weekday(Date), 'sat', 'sun')"} >} CallerID)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

May be this

Count({<Date = {"=Match(WeekDay(Date), 'Sat', 'Sun')"}>}CallID)
Mdjenkins
Contributor II
Contributor II
Author

For some reason, this method always returns all days. It does not limit the scope to Sat and Sun
Mdjenkins
Contributor II
Contributor II
Author

Hey guys, this is the solution.  I had mixed up the date fields