Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

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.

1 Solution

Accepted Solutions
MVP
MVP

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

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

4 Replies
MVP
MVP

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

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

Not applicable

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

Hi Miguel,

Thanks - this has got me a lot further, but now I get all the values from the list box conacternated in the caption for the chart, not just the selected value.

Trevor

MVP
MVP

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

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

Not applicable

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

Hi Stefan,

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

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

This works perfectly, both for single and multiple selections in my alternate state listbox.

Thanks !

Community Browser