7 Replies Latest reply: Feb 18, 2014 3:40 PM by Jaime Aguilar RSS

    List box single selection

      Hi,

      There is one list box as 'Time Period' in my report.

      There is a requirement that user should be able to select only one value at a time.

      But user should also be able to deselect it.So I cant check the always one selected value.

      Is there any way to solve this issue.

      Please find the attached list box image for the same.

       

      Thanks in Advance !!


        • Re: List box single selection

          You can use field event trigger on [time period] field to clear it if selectedcount >1. This is some work around to force user to select a single value. The expression to clear field will be if(GetSelectedCount([Time Period])>1,'[Time Period]').

           

          clear.bmp

          • Re: List box single selection
            Byron Van Wyk

            Lets look at it like this. If the user is able to deselect they are in essence making all values available in any object that references to that field as a dimension. In QlikView, it would be the same as selecting all values.

             

            However, if the chart or object using that value has a calculate conditional for when getselectedcount is one, then I can understand where this would be useful.

             

            My suggestion as I know no other way to clear the selection when only 1 selection is enabled is to do one of the following

             

            1) Create an input box with a concat function to list all values in a drop down. Forcing the user to select a value or blank

            2) Min or MaxString can be used to force QlikView to select one value even though the list box has multiple values. The value that will be used in the object can be represented by a text box indicating which value has taken precedence

            3) If your list box contains only a few options, then maybe FieldValue and FieldIndex can be used with a forced element number of 1

             

            Hope the above is useful to you in any way

             

            Cheers,

            Byron Van Wyk

            QlikVieW & Other Ramblings

            • Re: List box single selection

              Hello,

               

              QV 11 version....

              You can use in the listbox properties (General tab);

              oneselected.png

              I hope you are asking this information.

              Regards

              Murat

              • Re: List box single selection

                No I can't check Always one selected value property. Because it will not allow to deselect the option.

                • Re: List box single selection

                  Hello Priya,

                   

                  You can follow the steps below:

                  1. Go to Document Properties/ field trigger

                  2. On Select-->Select in Field

                  3. Time Period

                  4, in the expression Type:

                  If(getselectcount(TimePeriod),maxstring(TimePeriod))

                   

                  In this way user will be able to select/ deselect values but not multiselect. Instead of Maxstring minstring function can also be used.

                   

                  Hope it helps..

                  • Re: List box single selection
                    Jaime Aguilar

                    Hi,

                    Maybe like the attached example,

                     

                    regards