Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
palo173
Contributor III
Contributor III

Ignore filter but not Variable base on filter

Hello,

in set analysis I want to ignore active filter but not variable base on filter.

I try to ignore Dealer, but Dealer define variable vDistrictDealer. Do you have same idea for this?

Max(Aggr(Sum({< Fakt = {'Def'}, Year = {"$(=Year(vMaxDatZap))"}, [District] = {'$(vDistrictDealer)'}, Dealer= >}[#Reg]), [District],[Brand]))

Thank you

Labels (3)
8 Replies
Qrishna
Master
Master

whats your vDistrictDealer expression look like?

palo173
Contributor III
Contributor III
Author

vDistrictDealer = District_short .... for example BA or BB or CA etc.

And District_short and Dealer are columns in dimension table Dealer.

 

Qrishna
Master
Master

when you say 'I try to ignore Dealer, but Dealer define variable vDistrictDealer. '- you want to ignore Dealer selections in vDistrictDealer = District_short  too?

palo173
Contributor III
Contributor III
Author

I use filter for Dealer e.g. Dealer1. After that vDistrictDealer will value e.g. AB.

In my expression I want to Sum #Reg where District is AB, but I want to Sum #Reg for all dealers not only for Dealer1.

Max(Aggr(Sum({< Fakt = {'Def'}, Year = {"$(=Year(vMaxDatZap))"}, [District] = {'$(vDistrictDealer)'}, Dealer= >}[#Reg]), [District],[Brand]))

 

Qrishna
Master
Master

then why dont you try:

Max(Aggr(Sum({< Fakt = {'Def'}, Year = {"$(=Year(vMaxDatZap))"}, Dealer= >}[#Reg]), [District],[Brand]))

this sums up all while excluding Dealer selections

palo173
Contributor III
Contributor III
Author

It ignores District AB, so it sums all regs for each district and returns max value. But I need only sum for District AB. Others districts are unimportant.

Qrishna
Master
Master

Max(Aggr(Sum({< Fakt = {'Def'}, Year = {"$(=Year(vMaxDatZap))"}, [District] = {'AB'}, Dealer= >}[#Reg]), [District],[Brand]))

This  sums up all [#Reg] for just [District] = {'AB'} while ignoring any selections on Dealer.

i would suggest to give a sample data and an expected output view, that would reduce all these clarifications.

palo173
Contributor III
Contributor III
Author

I know, it is hard to advice, without giving data, but I can not.
Do you have any other ideas, or I'll give up?

This works fine with active filter for Dealer, but it is only for summing.

 

Sum({< Fakt = {'Def'}, Year = {"$(=Year(vMaxDatZap))"}, [District] = {'$(vDistrictDealer)'}, Dealer =  >}[#Reg])

 

But when I add Aggr and Max it does not work

 

Max(Aggr(Sum({< Fakt = {'Def'}, Year = {"$(=Year(vMaxDatZap))"}, [District] = {'$(vDistrictDealer)'}, Dealer= >}[#Reg]), [District],[Brand]))​

 

And this code works only when I have Dealer filter off. But I have to comment District, because in this case variable has no value. 

 

Max(Aggr(Sum({< Fakt = {'Def'}, Year = {"$(=Year(vMaxDatZap))"}, /*[District] = {'$(vDistrictDealer)'},*/ Dealer= >}[#Reg]), [District],[Brand]))

 

This suggests to me that in functions Aggr and Max I should also somehow ignore. Or?