Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
piyush01
Contributor III
Contributor III

On selecting any year how to get result of previous year

i want previous year data on my guage chart, on selecting screenshoot.pngany year from year list box..I need help to do so

1 Solution

Accepted Solutions
piyush01
Contributor III
Contributor III
Author

Actually the syntax send by our friend Halmar Heijnen has something missing....so, when you compare both the syntax you will come to about the error. Right syntax is bellow....

=sum({$<Year={"$(vMax1)"}>} Sales)

View solution in original post

8 Replies
Not applicable

Hi,

Add some set analyses in your expression like:

sum({<Year={"$(=max(Year)-1)>} Sales)

Succes, Halmar

piyush01
Contributor III
Contributor III
Author

Thanx Halmar...it works

Not applicable

Hi Halmar,

       When I am trying this same one I didnt get any data.Do I need to change any syntex?

-Jai

piyush01
Contributor III
Contributor III
Author

Actually the syntax send by our friend Halmar Heijnen has something missing....so, when you compare both the syntax you will come to about the error. Right syntax is bellow....

=sum({$<Year={"$(vMax1)"}>} Sales)

SunilChauhan
Champion
Champion

hi jai

you can use this code

sum({<year={"$(=max(year)-1)"}>} sale)

Sunil Chauhan
SunilChauhan
Champion
Champion

piyush still

$(vMax1) needs to define

Sunil Chauhan
piyush01
Contributor III
Contributor III
Author

Hi Sunil,

vMax is a variable

=Max(Year)-1....

nw fine?

SunilChauhan
Champion
Champion

good

Sunil Chauhan