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: 
Anonymous
Not applicable

set analysis?


i have years list box like

year:

[

2000

2001

2002

2003

2004

2005

2006

2007

2008

];

my req is when i click on any year i want to get sales from that year to next 3 years.

like  if i select 2002  then  2002,2003,2004,2005 sales i want see

like wise  2003 if i select  then   2004,2005,2006,2007

how? please give me expression

1 Solution

Accepted Solutions
Not applicable
Author

Try this

Here if you select a year it vl display from that year and above three years which u selected.

sum( {<year={'>=(=max(year)) =<(=Max(year)+3)'}>} Sales)

Here if you select a year it vl display above four years which u selected year.

sum( {<year={'>=(=max(year)+1) =<(=Max(year)+4)'}>} Sales)

View solution in original post

9 Replies
Not applicable
Author

Try this

sum( {<year={'>=(=max(year)) =<(=Max(year)+3)'}>} Sales)

Anonymous
Not applicable
Author

inkoka question pettanu adhi chusara

Not applicable
Author

Try this

Here if you select a year it vl display from that year and above three years which u selected.

sum( {<year={'>=(=max(year)) =<(=Max(year)+3)'}>} Sales)

Here if you select a year it vl display above four years which u selected year.

sum( {<year={'>=(=max(year)+1) =<(=Max(year)+4)'}>} Sales)

sujeetsingh
Master III
Master III

Why not to try iff

manideep78
Partner - Specialist
Partner - Specialist

Hello,

Please communicate in English Language so that everyone in this community will try to help you.

I hope you understand. Thanks

Regards,

Manideep

senpradip007
Specialist III
Specialist III

PFA.  Hope it will serve your purpose.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

Try this

1. " if i select 2002  then  2002,2003,2004,2005 sales i want see"

Sum( {<Year={'>=(=Max(Year)) <=(=Max(Year)+3)'}>} Sales)

2. "2003 if i select  then   2004,2005,2006,2007"

Sum( {<Year={'>=(=Max(Year)+1) <=(=Max(Year)+4)'}>} Sales)

tcullinane
Creator II
Creator II

if you are looking to display each year rather than an accumulation might be easier to use variables so that;

vCurrentYear = max(Year)

vNextYear = vCurrentYear+1

vNextNextear = ....etc

and reference the variables rather than the field in expressions

Anonymous
Not applicable
Author

Hi Manideep,

I agree, but we have discussed at that time not realted to qv.