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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

count number of weeks with set analysis

Hi,

I'm trying to establish how many weeks a datespan contains and i don't get why the following set analysis doesn'r work:

count(Date= {">=$(=monthstart(AddMonths(Today(),-12)))<=$(=monthend(addmonths(Today(),-1)))"} >} distinct(YearWeek))

Pleas help.

Thanks!

//A.

2 Replies
Anonymous
Not applicable
Author

hi

try this

(WeekStart(date1) - WeekStart(date2))/7

jagan
Partner - Champion III
Partner - Champion III

Hi,

In script you create a new column like

Week(Date1) & '-' & Year(Date1) AS WeekYear

If you have the above column you can easily calculate the number of weeks by using the simple expression

=Count(DISTINCT WeekYear)

Hope this helps you.

Regards,

Jagan.