Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
danimarc12
Partner - Creator
Partner - Creator

Button with opposite selection

Hello everyone!

I have an issue with a button in Qlik Sense. I need to show 2 different kinds of products (ID):

  • The first ones are shown clicking on a button wich set these conditions: 1) Select values in field A=4; 2) Select values in field B= 1,2,4.
  • The second ones have to be shown by another button which has to select values in field A <>4 OR values in field B <> 1,2,4.

For the first button it's easy but how can I set the second button?

Could anyone help me please?

Thank you!

1 Solution

Accepted Solutions
chris_djih
Creator III
Creator III

you can use Match or Wildmatch (if you need wildcards).

If( FieldA <> 4 OR not Match(FieldB,1,2,4)

If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.

View solution in original post

7 Replies
vikasmahajan

Simply use excluded from button action

vikasmahajan_0-1642758306840.png

Vikas

 

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
danimarc12
Partner - Creator
Partner - Creator
Author

Hi @vikasmahajan ,

thanks for your answer. The solution isn't correct because of the logic meaning.

The contrary of "valueA  AND  valueB"  is not  "NOT valueA  AND NOT  valueB"

but

"NOT valueA OR NOT  valueB". So, If you exclude, you're using the wrong logic condition.

chris_djih
Creator III
Creator III

There is another action that says "Select alternative values" or sometihn like that.
So your way to go is:
1. Select values in field A=4
2. Select values in field B= 1,2,4
3. Select alternative values

If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.
danimarc12
Partner - Creator
Partner - Creator
Author

Hi @chris_djih ,

thanks for ur answer too. Unfortunately it's the same because the alterative values for each field is gonna make the wrong logical selection.

Maybe I have to create a new dimension in the LOAD SCRIPT EDITOR?!

If anyone could help me I'll be very thankful!

chris_djih
Creator III
Creator III

Yes, this would be my next suggestion, combining the 2 dimensions into a new one.

If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.
danimarc12
Partner - Creator
Partner - Creator
Author

So @chris_djih  how should I write correctly the new dimension?

LOAD

if(fieldA <> 4 OR fieldB <> {1,2,4}, productID)   AS newfield

??

How can I exclude more than one value in the IF statement?

chris_djih
Creator III
Creator III

you can use Match or Wildmatch (if you need wildcards).

If( FieldA <> 4 OR not Match(FieldB,1,2,4)

If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.