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

I have a year field and it contains the values from 2000 to 2010. I need set expression in such way that, i want to select previous 4 year information along with current selection. For example if i select 2004, i should get the the 2000, 2001, 2002 and 2003 information along with 2004.

5 Replies
tresesco
MVP
MVP

Try like:

Sum({<Year={">$(=Max(Year)-4) <=$(=Max(Year))"}>} Sales)

amit_saini
Master III
Master III

Viresh,

Try like this:

Sum({<Year = {"$(=max(Year)-4)"}>}Sales)

Thanks,

AS

jagadeesh_diamo
Contributor III
Contributor III

you can use a trigger that triggers a 'select in field action' to select the next 4 years as well.

Take a look below and test the attached if you need

Soltion.jpg

or

create a variable v1=max(year)

sum({<year={'=>(v1) <=(v1-4)'} Sales)

Thanks,

Jagadeesh

Anonymous
Not applicable
Author

create a variable V1=MAX(Year)

sum({<year={'=>(V1) <=(V1-4)'} QTY)

avkeep01
Partner - Specialist
Partner - Specialist

Hi Viresh,

I've attached some documentation about Set analysis that i found on the forum. Maybe it will help you.

Regards,

Anton