Skip to main content
Announcements
April 9th: The AI Roadmap: 6 Landmarks for AI-ready Data and Analytics: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
palo173
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)
12 Replies
Qrishna
Master

whats your vDistrictDealer expression look like?

palo173
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

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
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

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
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

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
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?

Qrishna
Master

do this: mockup your data/dummy data in an excel and attach it or paste it here. i dont need to see the exact data. all i want see is some dummy data and expected output view.