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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
richard_chilvers
Specialist
Specialist

Count how many Tuesdays between 2 dates

Is there a smart way of counting the number of Tuesdays there are between 2 dates ?

 

Thanks

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

You may apply it in this way:

count({< [Weekday] = {2}>} [Date])

whereby weekday must exists as a native field within the data-model which is usually the case by using a master-calendar.

- Marcus

View solution in original post

3 Replies
lironbaram
Partner - Master III
Partner - Master III

Hi 
this expression should work for you 

=sum(if(weekday(dateField)=2,1,0))

You need to replace "dateField" with your actual date field.

richard_chilvers
Specialist
Specialist
Author

Thank you.

I guess I can use set analysis to define the date range I'm interested in ?

marcus_sommer

You may apply it in this way:

count({< [Weekday] = {2}>} [Date])

whereby weekday must exists as a native field within the data-model which is usually the case by using a master-calendar.

- Marcus