Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
Cbhuvi27
Contributor III
Contributor III

Use Alternate state selection in common filter

Hello All,

I have few filters in which 2 of those have alternate state applied and other ones are common. Now how to make selection made in alternate state to be applied in normal one and vice versa.

Labels (4)
1 Solution

Accepted Solutions
Antoine04
Partner - Creator III
Partner - Creator III

OK, I got it :

Antoine04_0-1708010364501.png

So what you need is :

• One variable named Site1 : =If(Not IsNull(GetCurrentSelections(' | ', ':', ',' , 1, 'Site1')),'Site1+','')

• One variable named Site2 : =If(Not IsNull(GetCurrentSelections(' | ', ':', ',' , 1, 'Site2')),'Site2+','')

Then, it should work using them like this in the filterpane :

=If(WildMatch('$(=Concat(Distinct {$(=Coalesce(Left('$(Site1)$(Site2)',Len('$(Site1)$(Site2)')-1),'$'))} Rayon,'|'))','*'&Rayon&'*'), Rayon)

It works for me !

View solution in original post

11 Replies
Antoine04
Partner - Creator III
Partner - Creator III

Hello,

You need to use the name of your alternative state in your expression.

For example if your alternate state is called S1, then you can have :

Sum({S1} Sales) : that will give you the sales for the S1

Sum(Sales) : that will give you the sales for all your data

Sum({S1*$} Sales) : that will mix the both

Antoine04_0-1708001352326.png

Antoine04_1-1708001392809.png

 

Best Regards,

Antoine L

Cbhuvi27
Contributor III
Contributor III
Author

Hello Antonie,

Thanks much for your reply, but I want to apply multiple alternate state on other filters and not one measures.

Antoine04
Partner - Creator III
Partner - Creator III

I don't get it. You want the "normal" filterpane to be filter according to the selections of your S1 ?

Can you give a concrete example ?

Thanks

Cbhuvi27
Contributor III
Contributor III
Author

Partially Yes, the normal filterpane should get filterred based on the selections of S1,S2 and S3

 

aggr(only({[S1],[S2],[S3]}City),City)

 

I am using above query to apply multiple alternate states on the City but its not working in this way

Antoine04
Partner - Creator III
Partner - Creator III

OK I get it, so I have this :

Antoine04_0-1708004922812.png

And if I filter in my S1 on Beers, I then have this :

Antoine04_1-1708004957265.png

Boissons = Drinks

And here is the formula in the filter pane : 

=If(WildMatch('$(=Concat({Site1} Rayon,'|'))','*'&Rayon&'*'), Rayon)

Cbhuvi27
Contributor III
Contributor III
Author

So you applied S1 on categories ? if so then yes, here we have only one State that is S1 but I wanted to apply for 3 Alternate state

Antoine04
Partner - Creator III
Partner - Creator III

Yes, it's working with multiples alternates states :

Antoine04_0-1708005354670.png

 

You need to modify the formula like this in the filterpane: 

=If(WildMatch('$(=Concat(distinct{Site1+Site2} Rayon,'|'))','*'&Rayon&'*'), Rayon)

Cbhuvi27
Contributor III
Contributor III
Author

Hello Antonie, this is working only if I select something in all three states. If I am doing for one filter with Alternate state its not working.

Antoine04
Partner - Creator III
Partner - Creator III

OK, I got it :

Antoine04_0-1708010364501.png

So what you need is :

• One variable named Site1 : =If(Not IsNull(GetCurrentSelections(' | ', ':', ',' , 1, 'Site1')),'Site1+','')

• One variable named Site2 : =If(Not IsNull(GetCurrentSelections(' | ', ':', ',' , 1, 'Site2')),'Site2+','')

Then, it should work using them like this in the filterpane :

=If(WildMatch('$(=Concat(Distinct {$(=Coalesce(Left('$(Site1)$(Site2)',Len('$(Site1)$(Site2)')-1),'$'))} Rayon,'|'))','*'&Rayon&'*'), Rayon)

It works for me !