
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Count if on chart
Hello guys,
I tried to search in the community but I couldn't find a similar question.
I'd like to add one more info to a Gauge chart with the result of last year (2017). I set the following expression but I get an error message and it doesn' work:
Count({<UserName={'NAME'},Year(DocDta)={'2017'} >} DocNum)
UserName it's an user associated to the transaction, DocDta it's a date value such as 11/12/2018 and DocNum it's an ID.
Thank you very much for your help!
- Tags:
- chart
- count
- qlik sense
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Create year field in the script and refer the same in set analysis like:
Year(DocDta) as DocYear Count({<UserName={'NAME'},DocYear={'2017'} >} DocNum)
Else, use if statement like:
Count({<UserName={'NAME'}>} if(Year(DocDta)=2017, DocNum))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Create year field in the script and refer the same in set analysis like:
Year(DocDta) as DocYear Count({<UserName={'NAME'},DocYear={'2017'} >} DocNum)
Else, use if statement like:
Count({<UserName={'NAME'}>} if(Year(DocDta)=2017, DocNum))


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The LHS of a set qualifier must be a field name. Expressions are not allowed. Follow Tresesco's advice about creating the field in the load script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Year(DocDta)
try to put this as filter see wither you getting those expected years or not may it is to do with date format
your expression looking good
