4 Replies Latest reply: Jan 13, 2012 10:05 AM by Trevor Olney-Jones RSS

    Add a list box selected item text to a charts caption.

      Hi, this is my first ever post and I'm very new to Qlikview - not even had my training yet.  I'm trying something that I hope is possible and simple to do, it's just that I'm not sure how to do it.  What I would like to do is to put the text from a single or multiple selection in a list box, into the title of an associated chart.  This will aid my users in knowing what's currently selected and will make the chart more meaningful.  The next step for this, is having a chart with two expression based on alternate states for the user to be able to perform comparisons.  This I will have two list boxes in alternate states and I will like the selections from both to be reflected in the caption of the graph.  Hopefully someone will be able to help and point me in the right direction.

        • Re: Add a list box selected item text to a charts caption.
          Miguel Angel Baeyens de Arce

          Hi,

           

          Try to set the caption of the chart to

           

          ='Values for ' & Concat(DISTINCT Field, ',')
          

           

          Change "Field" by the field you they are selecting.

           

          Hope that helps.

           

          Miguel

          • Add a list box selected item text to a charts caption.
            Stefan Wühl

            You can list the selections in a field either by using

            =GetFieldSelections( YOURFIELD, ' ,' )

             

            or by

            =concat(distinct YOURFIELD, ', ')

             

            There is a difference in the way the functions handle if you have no explicite selections in that field (e.g. all values are possible, 'white' values in a list box): GetFieldSelections will return no values (or in other words, will only return explicitely selected  values), while concat will return all possible (explicitely and implicitely selected values).

             

            If you use on of these functions in a chart object, it will list the selections of the YOURFIELD depending on the state your chart object you are using this function is in. So, if your chart object, e.g. a text box, is in default state, it will list the values of your listbox that is also in default state.

             

            If you want to list the values of two list boxes in two different states in one expression, you could use concat with a set expression, like:

             

            ='Default state values: '& concat(distinct YOURFIELD , ' ,') &

            'Alt1 state values: ' & concat({<YOURFIELD=Alt1::YOURFIELD >} distinct YOURFIELD,', ')

             

            (I am using the expression in a text box in default state for this demonstration).

             

            Hope this helps,

            Stefan