Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Arnec
Contributor III
Contributor III

Multiple selection in listbox

Hi!

I'm having a little trouble selecting multiple items in a listbox. The listbox content is based on the script:

Comparison:
Load * Inline [
comp_ID, comp_Name
1, Turnover
2, Margin
3, Tickets
];

The graphs that I have on my dashboard are then built conditionally through an expression. There's one expression for each item in Comparison:

if(match(getFieldSelections(comp_Name), 'Turnover'), Sum(DocTotal))

This seems to work if an individual item is selected. However if I select more than 1 item. I receive a message that there is no data to display.

If I remove the IF clause and just look at the sums, all 3 are combined perfectly, so the data is there. What may be causing this behaviour?

Labels (2)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

You could try to use wildmatch() instead of match()

 

 

if(wildmatch(getFieldSelections(comp_Name), '*Turnover*'), Sum(DocTotal))

 

  

See: wildmatch - script and chart function

View solution in original post

4 Replies
dplr-rn
Partner - Master III
Partner - Master III

change getfieldselections functions to concat(comp_Name,'  ')

getfield selection might return 'x of y values'  when too many values are selected. concat is more reliable

Arnec
Contributor III
Contributor III
Author

Hi

Thanks for your reply, but if I replace getFieldSelections by Concat, I can't even build the graph using 1 selection. Now it seems as if there is no data at all.

 

Arne

Vegar
MVP
MVP

You could try to use wildmatch() instead of match()

 

 

if(wildmatch(getFieldSelections(comp_Name), '*Turnover*'), Sum(DocTotal))

 

  

See: wildmatch - script and chart function

Brett_Bleess
Former Employee
Former Employee

Arne, did Vegar's last post get you any further, or are you still working upon things?  If his post did help, consider using the Accept as Solution button on that post to give him credit.  If you have figured something else out, consider posting what you did and then mark that post.  If you are still trying to work things out, leave an update on where you are with things, and we'll see if anyone else has any further ideas.

The only other thing I have for you would be to search around in the Design Blog area, there are a lot of great how-to posts there, not sure what you need here, so I am not going to try to pick any for you, I will let you search on your own, but I am betting you can likely find something that may help you here.

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.