Community Corner

Discussion board for questions about the Qlik Community, its features, sharing information, general discussions and even some fun. This is for both new and longtime community members. Everyone is welcome!

New Contributor

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 MVP

Re: Qlik Sense

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])
New Contributor

Re: Qlik Sense

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

Re: Qlik Sense

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

New Contributor

Re: Qlik Sense

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])
Community Browser