Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

Populating Dimension Filter Using Only Aggregate Function

Hey Guys,

Need your help to solve this problem

I have two Dimensions namely : Country and States

i am using the Country dimension as a variable and making its selection possible using a variable drop down.  Also i have another dimension filter of states where i am using Qlik Native filter.  What i want to do is, whenever i am selecting India in my country variable, i want it to show me only relevant states and if US then the states of US.

CountryState
IndiaDelhi
IndiaMumbai
IndiaTamil Nadu
IndiaRajasthan
IndiaKolkata
USCalafornia
USTexas
USFlorida
USWashington

 

for country i am using $(vCountry) and for State i am using [State] dimension as a native filter. 

to calculate this i used Only function :

=Aggr(Only({<product={'$(vBU)'}>}[SP Name]), [SP Name])

But what happens is that if i select a country India, it shows me all the states of India and when i select a state, except the selected state all the other Indian States disappear. All i want is to retain those indian states as well.

Kind of an urgent and important problem statement for me. Please help out. 

1 Solution

Accepted Solutions
Highlighted
Contributor II
Contributor II

well i found the solution to do this. 

you could use the below given expression to populate that

=Aggr(Only({1<product={'$(vBU)'}>}[SP Name]), [SP Name])

Well definitely thats simple solution to a simple question. 

View solution in original post

3 Replies
Highlighted
Partner
Partner

hi 

why don't you use the native filter for both country and state 

it make that much more sense , and it will allow you to not waste time on this matter 

Highlighted
Contributor II
Contributor II

@lironbaram there was an ask for it and to maintain a consistency, but the business requirement changed recently and converting it to native filter would be a lot of hardowork

Highlighted
Contributor II
Contributor II

well i found the solution to do this. 

you could use the below given expression to populate that

=Aggr(Only({1<product={'$(vBU)'}>}[SP Name]), [SP Name])

Well definitely thats simple solution to a simple question. 

View solution in original post