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

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

1 Solution

Accepted Solutions
sunny_talwar

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

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

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