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: 
Not applicable

piped variable in button not working

Hello,

I have a list of sales people that I want to use as the search string for a button, using "Select in Field". I create a variable from an Excel

file that is maintained by our Admin group (this way, I don't have to change any code when we add/lose sales people, as happens frequently!). The variable is called "vUSSalesPipe", and consists of the four-letter user codes with a 'pipe' (ASC(124)) in between.

To check my routine, I have a text box: ='the variable is '('&'$(vUSSalesPipe)'&')' The output of the text box is shown below:

USPipe.PNG

This looks good to me. (I don't think I need spaces between user codes and the pipes, do I?)

So, in my Button properties, I chose "Select In Field", the correct field name, and in the search box entered:

= '('&'$(vUSSalesPipe)'&')' (note: I tried it both with and without the equals sign in front)


But when I select the Button, no users are selected.


I'm sure this is just a syntax error on my part, but if anyone has suggestions on how to accomplish this, I'd

appreciate their input!


thanks,


Kevin

1 Solution

Accepted Solutions
sunny_talwar

Your field name is OMUser and not OMUSER. Are you using the correct fieldname?

View solution in original post

9 Replies
sunny_talwar

I think for multiple select in field you need double quotes around each value

("BMOR"|"EKES"|...)

Modify your variable and add " after the opening parenthesis and before closing parenthesis:


= '("'&'$(vUSSalesPipe)'&'")'

swuehl
MVP
MVP

Have you tried copying the complete literal to a list box search bar of that field?

(And I assume you just entered the field name in entry box of button action property, not leading equal sign?)

Could you post a small sample QVW that demonstrates your issue?

Not applicable
Author

Hmm.. I tried putting in the formula (with and without preceding "=" sign in the Listbox) -> no result

However, when I manually typed in the first three values, e.g. (BMOR|EKES|HPRI), they were selected. However, that's in the Listbox search bar.

So, I don't think I need the "" as Sunny suggested (that's if you have two items between one set of pipes, IIRC, e.g.

("BMOR EKES" | HPRI).

Here's my button:

Qvar.PNG

I tried the search string as above, with single quotes around it, and with a leading "=" sign (with and without single quotes). Not one of these is effective.

I'm sure I'm missing something simple, but what it is is beyond me at the moment!

sunny_talwar

Would you be able to share a screenshot of OMUSER listbox?

Not applicable
Author

Absolutely..

QVP.PNG

swuehl
MVP
MVP

Field name is correct, case sensitive?

sunny_talwar

Your field name is OMUser and not OMUSER. Are you using the correct fieldname?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Your expression works fine for me. Can you post a sample qvw?

-Rob

Not applicable
Author

You and Stefan are correct.. the case was wrong.

In case anyone else is interested, the working solution was:

qvpnew.PNG

Thanks for everyone's help!