Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead 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
swuehl
MVP
MVP

Try

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


Remember, it's called Dollar-Sign expansion,

View solution in original post

8 Replies
tresesco
MVP
MVP

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

swuehl
MVP
MVP

Try

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


Remember, it's called Dollar-Sign expansion,

Anonymous
Not applicable
Author

Simple number like '2016'

tresesco
MVP
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

swuehl
MVP
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

moojahid2
Partner - Contributor III
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())

today.JPGYearToday.JPG

 

 

Ozturkec
Contributor
Contributor

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

Thanks!