Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Don't miss the upcoming Q&A with Qlik session on Qlik Application Automation on November 16th! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
sayali_gajare
Contributor
Contributor

Previous year for selected year from filter

if(GetSelectedCount(InvYear)=1,

Sum({$<Year={'$(=max(InvYear)-1)'}>} [#GrossAmount]*ConvertRate),

Sum([#GrossAmount]*ConvertRate)

)

 

currently I have data for year 2018,19,20,21

when I select any year from filter I didnt get previous year data it shows data for selected year only

3 Replies
Taoufiq_Zarra

@sayali_gajare  Maye be :

if(GetSelectedCount(InvYear)=1,

Sum({$<Year={'$(=getfieldselections(InvYear)-1)'}>} [#GrossAmount]*ConvertRate),

Sum([#GrossAmount]*ConvertRate)

)
Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
sayali_gajare
Contributor
Contributor
Author

Thanks but not working

AshutoshBhumkar
Partner
Partner

Hi,

Can you please post an image of how your expression editor looks like and what is being calculated in set expressions?

Maybe, that will help us to understand more. The same kind of expression is working for me.

e.g 

If(GetSelectedCount (Year)=1,
Sum({<Year = {"$(=Max(Year)-1)"}>}Sales),
Sum(Sales)
)

Thanks,

Ashutosh