Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Finding count of all Sundays in the Given Date Range

Hi All,

     I want to Find Count of all Sundays in the Given Data Range i.e From And To Date.

Eg.

     From Date        To Date

     1-Sep-2011     20-Sep-2011

Nos Of Sundays = 3

How Can I achieve this ?

2 Replies
gandalfgray
Specialist II
Specialist II

Hi Nandkishor

Try this  (replace 'sun' to what you use):

=sum({<Date={">=$(FromDate) <=$(ToDate)"}>} if(Weekday(Date)='sun', 1, 0))

hth/gg

its_anandrjs

Hi,

If it is single date column try this out for date column

=sum( if ( Weekday ( YourDateField ) = 'Sun', 1, 0 ) )

Regards,

Anand