Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
adann_CB_96
Contributor
Contributor

Button for filtering data in a column to show, that the data doesn't exist

Dear Community,

I hope someone can help me with my problem in Qlik Sense.

I have a simple table in one my apps and I created a button for data filtering.

Source System     Contract_ID          Product_type
A                             3456678                64
A                             7845704                GID
B                             6587654                RMB
B                             6587690                64
B                             3254378                85

My goal is to click the button, so that a user can see in a table only product types: 64 and 85.

The first "Action" is clearing the sheet from all other selections and the other is to select the data: ='(64|85)'

Capture.PNG

The problem is, that I must force the button to show nothing when two specific product types don't exist. If there is no product type like 64 or 85, the table must be empty.

I tried some if or switch case statements, but without success.

Can anybody have an idea how to solve it?

Labels (4)
4 Replies
Or
MVP
MVP

You can't force a selection on a value that doesn't exist - Qlik doesn't work that way. You could instead use the object's calculation condition and a variable toggle. When the button is clicked, the variable is toggled from 0 to 1. The calculation condition would then be something like:

If(vToggle = 1 and Count({< Product_Type = {64,85} >} SomeField) = 0, 0, 1)

You could achieve the same thing without the calculation condition if you have a measure, by introducing the set in an if() statement.

Gabbar
Specialist
Specialist

as Suggested by @Or ,
But If you want a Work Around you can concat those two Values in the Column in Script Editor, So that those two values Exist For filter Pane and Now in Any of the Column You Can untick 'Include Null Values'. 
With this you have a value for filter pane and by unticking you wont get those two additional Rows.

adann_CB_96
Contributor
Contributor
Author

Can You please show me all steps how to do that? Should the variable be created in "Actions and navigation" panel inside a button? What is "SomeField"?

Or
MVP
MVP

Variables are created at the app level.

Somefield is just that. Some field from your app that you can count to see if there are any values for that selection.