Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
eadbhard
Contributor III
Contributor III

Show a chart only when a list of values is selected in a ListBox

Hi there,

I have a chart that I want to show conditionally, only if a certain (specific) list of values is selected in a ListBox. In the example below, the "Monthly Extra Costs" chart should display only when "A. PALAZUELOS Y CIA, S.C.", "AKZENT LOGISTICS, S.A. DE C.V." and "ARCATEK, S.A. DE C.V." are selected in the 'Cliente_US' listbox (all of them).

screenshot.png

Please, how can I accomplish this?

Thanks and kind regards.

-E. Alvarez

1 Solution

Accepted Solutions
eadbhard
Contributor III
Contributor III
Author

I found the solution 😊

=If(SubStringCount(GetFieldSelections(Cliente_US),'A. PALAZUELOS Y CIA, S.C.') +
SubStringCount(GetFieldSelections(Cliente_US),'AKZENT LOGISTICS, S.A. DE C.V.') +
SubStringCount(GetFieldSelections(Cliente_US),'ARCATEK, S.A. DE C.V.')>0,1,0)

With this, the chart is shown when any combination of the company names is selected, either just one company, or any two companies, or all three companies. Selecting any other company in the ListBox (or clearing all selections) makes the chart disappear.

SubStringCount() did the trick here, this function gets along better with GetFieldSelections() than Match().

Thanks for all the help!

 

 

View solution in original post

4 Replies
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

In chart properties > layout > Show conditional : 

if(match(GetFieldSelections(Cliente_US),'A. PALAZUELOS Y CIA, S.C.', 'AKZENT LOGISTICS, S.A. DE C.V.','ARCATEK, S.A. DE C.V.'),1,0)

eadbhard
Contributor III
Contributor III
Author

Thanks, but with this solution, the chart is shown if I select just one of the required values in the ListBox. If I select two or all three values, the chart is not shown.

Now, would it be possible to show the chart when any combination of the required values is selected, being just one value, any two values, or all three?

Thanks and kind regards,

-E. Alvarez

Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Try this:

if(GetSelectedCount(Cliente_US)>0,1,0)

eadbhard
Contributor III
Contributor III
Author

I found the solution 😊

=If(SubStringCount(GetFieldSelections(Cliente_US),'A. PALAZUELOS Y CIA, S.C.') +
SubStringCount(GetFieldSelections(Cliente_US),'AKZENT LOGISTICS, S.A. DE C.V.') +
SubStringCount(GetFieldSelections(Cliente_US),'ARCATEK, S.A. DE C.V.')>0,1,0)

With this, the chart is shown when any combination of the company names is selected, either just one company, or any two companies, or all three companies. Selecting any other company in the ListBox (or clearing all selections) makes the chart disappear.

SubStringCount() did the trick here, this function gets along better with GetFieldSelections() than Match().

Thanks for all the help!