Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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)'
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?
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.
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.
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"?
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.