Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Excluding names from a Listbox

Hi All,

I'm struggling to exclude certain names from a Listbox I have created - Field is CVsSent.CONSULTANT. As it stands, the listbox is displaying every person's name in the company but i'd like to remove / hide a few of them if possible so they no longer feature in the box.

For example:

John

Paul

James

Sarah

Julia

Jon

Simon

Andrew

How would I go about removing Jon, Simon and Andrew so they are no longer displayed in the Listbox? I'm guessing by adding an expression in the ListBox properties but each time I do, it doesn't work. I think it's something basic but I'm very new to this.

Thanks so much,

Lindsay

19 Replies
Not applicable
Author

It's now growing back 🙂

In terms of applying the same expression to a chart, would I be right in saying that I don't go to the Expressions tab and add this as a new expression...?

currently i've just got Count (CVsSent.CONSULTANT)

Not applicable
Author

So in your chart you count cvssent.consultant

But What is your dimension?

Not applicable
Author

I hope you didn't miss the bit that said i was new to this 😉

Used Dimensions is currently CVsSent.CONSULTANT

I'm assuming that's where you mean?

Not applicable
Author

Hi huncie247,

Yes, that's basically what I mean. But that would mean that your chart shows a count of CVsSent.Consultant per CVsSent.Consultant. Does that make sense?

In that case, your dimension can be a calculated dimension (just click edit on the dimension tab and paste there the same code as you put in  your listbox). Your expression can stay "as is"

Not applicable
Author

Hi Roberto, been out of the office for the last few days and just come back to this.

Yep, that's great and has worked. For some reason though, my chart shows 8 names in a bar chart format which is fine and expected, but there is now a 9th bar at the end which appears to be a view of the total count of all 8 names. No name appears under it, just a - symbol.

Similarly, if i hover the mouse over each bar, it displays the "if" expression and then the total number. i.e.

if(

CVsSent.CONSULTANT <>'Jon' and

CVsSent.CONSULTANT <>'Simon' and

CVsSent.CONSULTANT <>'Andrew' ,

CVsSent.CONSULTANT)

=154

Thx,

L

Not applicable
Author

Hi,

You're executing a Count (CVsSent.CONSULTANT) against the calculated dimension that you state above...

That means that this count will be executed for all consultants except Jon,Simon,Andrew.

I guess that the 9th bar is the count for these 3 guys.

You can do 2 things...

1: add an "others" group

You could change the expression so that those 3 names are included in the "others" group. Then use this as your calculated dimension:

if(

CVsSent.CONSULTANT <>'Jon' and

CVsSent.CONSULTANT <>'Simon' and

CVsSent.CONSULTANT <>'Andrew' ,

CVsSent.CONSULTANT

//here the else statement...

,

'Others'

)

2: Hide that 9th bar

The 9th bar IMO exists because apparently Jon,Siman and/or Andrew also have cvsSent (so a count for them results in I guess 154). But the dimension is NULL (because of your calculated dimension

On the dimensions tab you could check the checkbox "suppress when value is null"

>>PS: I would double check if the right things are suppressed (should be the cvsSentconsultant for the 3 excluded persons...

Not applicable
Author

yep perfect! now all displaying correctly. do you have an email address i contact you directly on next time i need some help? as i said i'm very new to this and there will be a few things no doubt, as long as you don't mind assisting...?

Not applicable
Author

Hmz, I didn't plan to put my mailadress here on the forum. My mailbox may then become overloaded with requests (which would perhaps be interesting when I could send invoice for the spent hours 🙂 )

Lets not do that and keep it to helping eachother on this forum. Then even others can check the proposed solution and add their thoughts and comments.

Happy Qlikviewing!    

Not applicable
Author

lol, i thought that afterwards actually. no worries and thanks for your help to date!

Not applicable
Author

No problem. I was just kidding. I'm glad I could help, and am happy for the times that I received help.

Bye!