Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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 II
Champion II

hi jai

you can use this code

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

Sunil Chauhan
SunilChauhan
Champion II
Champion II

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 II
Champion II

good

Sunil Chauhan