Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Bookmark selection without valid case, return empty list or warning

The problem:
I want to create a list (tablebox) of cases that are the result of a bookmark with two field selections (field1=a and field2=b).

My problem is that when there is no case that applies to both selections, QlikView will reset field the first selection (field1=a) when applying the second (field2=b). As a result, the enduser will see a list of results with only values with selection field2=b active. (The enduser can know this by looking at the current selection box, but probably he won't).

Desired solution:

I apply the bookmark using a Apply Bookmark action button. I want one of those 2 behaviours:

1) Both selections will be applied, the enduser will see an empty list (I gues not possible in QlikView).

2) A popup will show, telling the users that there are no cases that meet both conditions (and possible the selection is erased)

Problem implementing solution2:

I want to check the number of fields where a selection is made after applying the bookmark (=nFieldSelects). If this number=2 ok, if this number=1 or 0 => selection is not made, show text box (with conditional show). Using the same button I execute a set variable action and I want to assign nFieldSelects number based on this post (Send to back | Qlik Community). However, the variable GetCurrentSelections() is only updated after the whole sequence of events of the button (set bookmark, set variable) is executed. Therefore, I get the number of selections before the bookmark is applied in stead of after that it is applied and I am unable to get the amount of succesfull applied selections in the same button trigger.

I hope someone can help me with either:

1) how to return an empty list instead of a list with only 1  out of two selections

2) How to get the number of fields where a selection is made after the application of the bookmark but still in the same action list of the same button.

Kind regards,

David

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Perhaps you can use alternate states. If you create two alternate states AS1 and AS2, create two listboxes for field1 and field2 and assign them to the two different alternate states then you can calculate if the intersection of the selections returns a result:

=If(sum({1}aggr(count({<field1=AS1::field1,field2=AS2::field2>}1),field1, field2))=0, 'This selection returns no results')


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar

Perhaps you can use alternate states. If you create two alternate states AS1 and AS2, create two listboxes for field1 and field2 and assign them to the two different alternate states then you can calculate if the intersection of the selections returns a result:

=If(sum({1}aggr(count({<field1=AS1::field1,field2=AS2::field2>}1),field1, field2))=0, 'This selection returns no results')


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Thank you for your quick reply.

In my case however, I have several scenarios, with some of them taking up to 5 different selections.

Therefore, I feel that alternate states would return in very complicated solution.

In the end I chose to show a popup text field (conditional show) after the button is clicked.

In that textbox it shows if the selection was made successfull.

I implemented it by defining a variable with the amount of fields in the bookmark when the button is clicked. Afterwards I show a textfield where I check the number of fields with a selection. (solution 2 but checking in the text field in stead of the button action).