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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis not working for previous year

Hi

Just trying to get some data using set analysis but running into a problem

I have a few buttons at the top where i can set the year i'm interested in

and putting this expression in

=count({$<RegYear={$(v_year)}>} distinct person_id)

works fine regardless of the year I select. e.g. 2016, 2015, 2014 , all bring back data

when i add a 2nd expression which tries to pull the previous years data using the expression

=count({$<RegYear = {$(v_year - 1) }>} distinct person_id)

the output is just a row of 0's

Can anyone spot any issues with this 2nd formula please

3 Replies
Anonymous
Not applicable
Author

Try this..

count({$<RegYear={$(v_year)-1}>} distinct person_id)

sunny_talwar

Try this:

=Count({$<RegYear = {$(=$(v_year) - 1)}>} DISTINCT person_id)

sasiparupudi1
Master III
Master III

=Sum({<RegYear={"$(=Max(RegYear)-1)"}>} DISTINCT person_id)