Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## Set Analysis with function of Year(today())

hi..Can you anybody please help me with the below expression. I have used set analysis and dont know what is going wrong with the syntax when I use year(today()) in it. I need to find out the count resolved tickets for current year. When I use the below expressions it shows 0

=count({<[Resolved Year] ={"&(=year(today()))"}>}[TR #])

1 Solution

Accepted Solutions
MVP

Try

=count({<[Resolved Year] ={"\$(=year(today()))"}>}[TR #])

Remember, it's called Dollar-Sign expansion,

8 Replies
MVP

How are the values in your field [Resolved Year]? Simple numbers like 2015, 2016 .. or 15-16..?

MVP

Try

=count({<[Resolved Year] ={"\$(=year(today()))"}>}[TR #])

Remember, it's called Dollar-Sign expansion,

Anonymous
Not applicable
Author

Simple number like '2016'

MVP

Then replacing '&' with '\$' should work (as spotted by Stefan)

Anonymous
Not applicable
Author

Thanks it worked.. when do i use & and \$ in the formula? I had used & in getfieldselection with setanalysis in the past

MVP
 Sanjyot Paktar wrote: Thanks it worked.. when do i use & and \$ in the formula? I had used & in getfieldselection with setanalysis in the past

Not sure how this should have worked. Any sample code?

In general, QV script and expression language syntax is defining how you need to write your code.

If in doubt, read the QV reference manual and HELP file, it's more often correct than wrong.

I highly recommend following Henric's blog posts and reading his tech docs, e.g.

The Magic of Dollar Expansions

Partner - Contributor III

Hi,

for test I'm giving Year(Today()), it shows 2.02k. However Today() shows exact date? what is the problem with  Year(Today())

Contributor

It is not working for Week(today()). could you help about these function but terms of Week?

Thanks!

Community Browser