Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Re: set analysis

Try like:

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

amit_saini
Honored Contributor III

Re: set analysis

Viresh,

Try like this:

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

Thanks,

AS

jagadeesh_diamo
New Contributor III

Re: set analysis

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

asimansari2017
New Contributor III

Re: set analysis

create a variable V1=MAX(Year)

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

avkeep01
Valued Contributor

Re: set analysis

Hi Viresh,

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

Regards,

Anton

Community Browser