Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Weekday expression

I'm trying to display # of Orders Per Day but exclude Sat and Sun. What would the set analysis be for this expression?

=num(count(Distinct [Order ID])/Count(DISTINCT [Creation Date]),'#,##0')

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

If you have a calendar in your script (Creating A Master Calendar)

You can use this -> {<WeekDay -= {'Sat', 'Sun'}>}

=Num(Count(Distinct {<WeekDay -= {'Sat', 'Sun'}>} [Order ID])/Count(DISTINCT {<WeekDay -= {'Sat', 'Sun'}>} [Creation Date]),'#,##0')

View solution in original post

4 Replies
sunny_talwar
MVP
MVP

If you have a calendar in your script (Creating A Master Calendar)

You can use this -> {<WeekDay -= {'Sat', 'Sun'}>}

=Num(Count(Distinct {<WeekDay -= {'Sat', 'Sun'}>} [Order ID])/Count(DISTINCT {<WeekDay -= {'Sat', 'Sun'}>} [Creation Date]),'#,##0')

tschullo
Creator III
Creator III

You could have a field that calculates the day of week from Creation Date, then add to your expression a qualifier of what days you want to count.

LOAD

...

wekkday( [Creation Date] as CreationDay

...

FROM data source;

=num(count(Distinct [Order ID])/Count({<CreationDay={0,1,2,3,4)>} DISTINCT [Creation Date]),'#,##0')

Not applicable
Author

Thanks Sunny, that did the trick. Now I also have a two other questions I can't really wrap my head around.

1. # Requestors who are submitting one request per day

2. # Requestors who are submitting one request per month

Request = [Order ID]

Requestors = [Requested By]

Date field= [Creation Date]

sunny_talwar
MVP
MVP

I suggest opening a new thread for a new requirement and also provide a sample so that its easy to offer quick help