Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
shree909
Partner - Specialist II
Partner - Specialist II

if statement

i have yeaid as 0,-1,-2,-3,-4 and i have filling date.so i have to build a pivot table

for example----if the yearid=0,filling year is 2012

if it is -1 it has to show 2011 and if it is -3,-4 it shows 2010 and 2009 like this.

so i have written a  expression year(sum{<yearid=0>}filling date).. so i stored in a variable

for -1 i just added -1 to the expression and stored in a variable ,for -2,-3 and -4  i did the same thing.

these dates i have to use it in the diemension when i clik onyearid=0 it shoiuld display,2012, if yearid=-1,2011

i can  display if i select 1 year, but if i select more than one yearid it displays null.finally yearid valuses should be driven by the filling year.

so how to use  using if statemetn.

can somebody help me plz

3 Replies
Anonymous
Not applicable

I don't understand why all this is needed.  Why don't you select years themselves - 2012, 2011, 2010, 2009?

shree909
Partner - Specialist II
Partner - Specialist II
Author

The thing is i dont have a year, i have only for 0 yr and i need to calcualte for the past 5yrs

Anonymous
Not applicable

You can do it in the script (on the front end too) without any if.

You know the current year - it is year(ReloadTime()).  So, for any yearid, the year is

year(ReloadTime())+yearid

That gives you:

0      2012

-1      2011

-2      2010

...