2 Replies Latest reply: Apr 15, 2016 9:37 AM by David De Wilde RSS

    Bookmark selection without valid case, return empty list or warning

    David De Wilde

      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

        • Re: Bookmark selection without valid case, return empty list or warning
          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')

          • Re: Bookmark selection without valid case, return empty list or warning
            David De Wilde

            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).