Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Read about Qlik’s Response to COVID-19 Read the Letter, Join the Group.
Highlighted
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
Highlighted
Contributor III

Re: set analysis not working for previous year

Try this..

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

Highlighted

Re: set analysis not working for previous year

Try this:

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

Highlighted
Honored Contributor III

Re: set analysis not working for previous year

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