Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
garvitgupta96
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
garvitgupta96
Contributor II
Contributor II
Author

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
lironbaram
Partner - Master III
Partner - Master III

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 

garvitgupta96
Contributor II
Contributor II
Author

@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

garvitgupta96
Contributor II
Contributor II
Author

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.