Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select in Field where Search String not Present

Hey -

Ive seen this question asked several different ways but never can find a clear answer.

The situation I am having is that I have a Button in which I would like to Select in Fiels a specific "Inventory" within a set of data. The possible Inventory selections are A, B, C, D.

Inventory D is a very rare Inventory and usually only shows up about once a year; howver, all of these Inventory selections are checked on a monthly basis.

When I create a Button to Select in Field Inventory D and its not there for most months within my Table Box data and Chart Box it displays all other Inventory selections A, B, and C since again D is not available most months.

My question being; How can I set my Button to only show selections for Inventory D and when Inventory D is not available it will show blank?

Appreciate any assistance, Thanks!

1 Solution

Accepted Solutions
rubenmarin

Hi Dylan, a sample will be nice to fully understand the behaviour. I can say that: if you have a field with a selected value and you execute an action to salect a value that doesn't exists in the field, it removes selections on the field, this seems related to what you see: the value doesn't exists -> selections on the field are removed -> you see all inventories.

You can use an expression to check if there are more than one possible inventory, and in this case hide (Design tab -> conditional show) or show a message (General tab -> Calculation condition) ('Messages...' button to customize messages).

The expression can be:

Count(DISTINCT Inventory)=1 // If there is only one inventory selected show/calculate the chart

View solution in original post

5 Replies
rubenmarin

Hi Dylan, not fully understand your requirements, if it helps you can check if inventory 'D' is in the possible values with:

Index(concat(distinct Inventario, ','), 'D') //Will return true if 'D' is in the possible values of Inventory

Gysbert_Wassenaar

You can try adding a calculation condition to your table box: =count({$<Inventory={'D'}>} Inventory)


talk is cheap, supply exceeds demand
Not applicable
Author

Hi -

I believe this is on the right path of what I am trying to accomplish.

However, upon button selection I am wanting the chart/tablebox to return null or blank if the selection ("D") is not present; instead it returns everything (A,B,C).

rubenmarin

Hi Dylan, a sample will be nice to fully understand the behaviour. I can say that: if you have a field with a selected value and you execute an action to salect a value that doesn't exists in the field, it removes selections on the field, this seems related to what you see: the value doesn't exists -> selections on the field are removed -> you see all inventories.

You can use an expression to check if there are more than one possible inventory, and in this case hide (Design tab -> conditional show) or show a message (General tab -> Calculation condition) ('Messages...' button to customize messages).

The expression can be:

Count(DISTINCT Inventory)=1 // If there is only one inventory selected show/calculate the chart

Not applicable
Author

Took me a few to get back to this;

I was able to utilize the Geneal Tab > Calculated condition with the below to "grey" out the button when the Inventory Selection of "D" is not available; which is perfect for what I am looking to do. Thanks!

=count({<INVENTORY={'D'}>}INVENTORY)