Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
pooja821
Creator
Creator

Number of weeks in a months

I need to calculate the number of weeks in a specific month.

i m using a expression like

week(monthend(Date)) - week(MonthEnd(addmonths(Date,-1,0))) .


But its not giving a right answer.


Kindly help.

2 Replies
rubenmarin

Hi Pooja, Week() waits for a date to return the week number this date belongs, you can do:

Ceil((monthend(Date) - MonthStart(Date))/7) // Or Floor instead of Ceil to round down

YoussefBelloum
Champion
Champion

Hi,

try this:

=week(MonthEnd(Date))-(week(MonthStart(Date))-1)