Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

How to show graph conditionally

Hi:

In a list box i have 5 values , on selecting a particular value i want to show a specific graph.

so if in list box A is selected then graph 1 should be shown

if in the list box B is selected then graph 2 should be shown.

Please let me know the solution to this.

4 Replies
Miguel_Angel_Baeyens
Not applicable

Re: How to show graph conditionally

Hi,

Go to the chart properties, Layout tab, and set in the Show, Conditional dialog the following expression in each chart, changing the value in the right as required.

GetFieldSelections(FieldNameHere) = 'A'

GetFieldSelections() will return the value or values selected in a field. That will return true if the value (and only that value) is selected in the listbox or any other object, and show the chart. When any other value is selected, the chart will be hidden.

Hope that helps.

Miguel

Not applicable

How to show graph conditionally

Miguel:

Thanks.

This code worked.

But now i am facing one more problem,

since it is a list box , when i select A , it shows up the graph but filters the whole dashboard with 'A' .

I think this is happening due to association.

I was hoping to just change these graphs based on the selections in the list box but rest of my boxes should remain

unchanged.

Is there a way to do this or should i use something else instead of list box.

Miguel_Angel_Baeyens
Not applicable

Re: How to show graph conditionally

Hi,

Glad to be helpful.

There are several approaches to that. Probably the most simple is going to the script and load only that field with a different name (in the listbox you can always change the label that is displayed in the dashboard). Then use this second field in the GetFieldSelections() instead of the previous. Since the name of this second field is different, and not related, it will not affect to your charts other than the how / hide property.

You can get that using variables instead of fields, but only in the case that one and only one chart is visible at a time.

Both of them are in the application attached.

There is a third approach that uses set analysis in the expressions. But since there are a lot of charts, and more information in the dashboard, I'd rather use one of the previous.

Hope that helps.

Miguel

Not applicable

How to show graph conditionally

Miguel:

It worked.

Thank you so much.