Announcements
Discover what’s possible with embedded analytics! March 6, 10 AM ET SIGN UP!
cancel
Showing results for
Did you mean:
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.

 Country State India Delhi India Mumbai India Tamil Nadu India Rajasthan India Kolkata US Calafornia US Texas US Florida US Washington

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.

Labels (6)

• ### SaaS

1 Solution

Accepted Solutions
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.

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

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

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.

Tags
Community Browser