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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
VS2
Contributor
Contributor

Set Expression

Hi, I want to see the count of dates that lie in current week.
I am using the expression 

=count({< [Date] = {">=$(=WeekStart(Today()))<=$(=WeekEnd(Today()))"}>}[Date])

but there is no output. 
Any suggestions on what am I doing wrong ?

Labels (4)
2 Replies
Taoufiq_Zarra
MVP
MVP

@VS2 

the Set is correct
in my opinion it is necessary to check the date format

=count({< [Date] = {">=$(=Date(WeekStart(Today()),'DATEFORMAT'))<=$(=WeekEnd(Today()))"}>}[Date])

DATEFORMAT is your date format

same for weekend

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
adamnuh
Contributor III
Contributor III

Hi @VS2 

In my experience dates in set analysis are very confusing and I try and avoid it where I can! In this instance I'd add a new field in your data model called e.g. ThisWeek- 

LOAD *

, IF [Date] >= DATE(WEEKSTART(TODAY())), 'Y', 'N') AS ThisWeek;

Then you can use that in your set analysis. COUNT({<ThisWeek={'Y'}>}[Date])

Not exactly what you were asking but hope it helps