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: 
shree909
Partner - Specialist II
Partner - Specialist II

nested If condition

Hi ,

  i have a  year like 2012 and i need to calculate the last 4 years like 2011,2010,2009,2008 i am able to write the expressions and get it,

but these thosuld be implemented in pivot table, i wrote nested if conditions depending on 2012 but i am not able to display  if 2  years  selected at a time,

i can only get the one year selected

please can some one help me in writing if conditon to select the multiple years.

so how to write a if  condition to select multiple years at a tym..

thanks

1 Reply
Anonymous
Not applicable

If you want to write an expression that sums up something over the last 4 years based on the Max year value that you've selected you can use set analysis:

sum({$<Year={"<=$(=Max(Year))>$(=Max(Year)-4)"}>} ValueField)