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

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Year dimension should show all last years

Hi all,

I have year as dimension and measure as sales. For example, I have years 2011,2012,2013,2014. So if I select 2014, it should all last years also; when I select 2013, it should show 2013/12/11. Also if there are total 10 years in the data, I want to keep it limited upto last five years including the selected year.

Please advise.

BR,

SAK

Labels (1)
1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

try this

=Sum({<Year={">=$(=Max(Year)-4)<=$(=Max(Year))"}>}Sales)

View solution in original post

4 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

try this

=Sum({<Year={">=$(=Max(Year)-4)<=$(=Max(Year))"}>}Sales)

Not applicable
Author

Also, I dont want to get it affected by the selection in months and quarters list boxes. Please advise.

Thanks!

PrashantSangle
MVP
MVP

Hi,

Nullify your Month Field in above expression

like

Try this

=Sum({<Year={">=$(=Max(Year)-4)<=$(=Max(Year))"},Month=>}Sales)


Or


=Sum({<Year={">=$(=Max(Year)-4)<=$(=Max(Year))"},Month={*}>}Sales)


Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
CELAMBARASAN
Partner - Champion
Partner - Champion

in set analysis using "FieldName=", will ignore the selections in that field

=Sum({<Year={">=$(=Max(Year)-4)<=$(=Max(Year))"}, Month=, Quarter=, Day=, Week=>}Sales)


Hope it helps