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: 
arvinserco
Contributor II
Contributor II

Qlik Sense

Hi all,

If  I have to create an expression by using filter and two max conditions, how it is possible that when i filtered out some data then that calculation will work as per that filter. Below is an expression used.

sum({<Weeks={$(=max({<[Destination]={$(=max([Destination]))}>}Weeks))}>}[Sales])

If i am filtering out Year 2019 then it will pickup max week as '01' follows with its sales number.

I hope I am clear with my query.

Thanks,

Arvind

4 Replies
sunny_talwar

This should already be doing that, isn't it? The expression below should change based on different selections you make... is it not doing that?

Sum({<Weeks = {$(=Max({<[Destination]={$(=Max([Destination]))}>} Weeks))}>} [Sales])
arvinserco
Contributor II
Contributor II
Author

No, even I tried to replace destination with year....
sunny_talwar

Would you be able to share a sample to show the issue?

arvinserco
Contributor II
Contributor II
Author

Thanks
It is working now
Current Year : Sum({<Weeks = {$(=Max({<[Year]={$(=Max([Year]))}>} Weeks))}>} [Sales])
Previous Year : Sum({<Weeks = {$(=Max({<[Year]={$(=Max([Year])-1)}>} Weeks))}>} [Sales])