Skip to Content

can i create a @prompt that includes '%' wildcards?

Oct 10, 2017 at 02:58 PM


avatar image
Former Member

Hopefully someone can provide me with a little clarity , i've spent hours trying to find an answer and doing a little trial and error.

Basically i want to create a condition in the universe that can be plonked in the query filters in webi. This condition would bring up a prompt for a text string to be entered by the user. that captured user input would then have '%' wildcards on either end when passed back for a free text field to be searched.


tab1.col1 like @prompt('Enter search text',A','%'+'class\obj'+'%',,)

The field is a free text field that i want users to be able to search for matching text.

so if they type 'Lion' in the prompt

they'd see entries that simply said 'Lion' and entries where 'Lion' was in the middle of a longer text string.

if there's a method of doing this in webi using the object and some clever manipulation of 'matches pattern', i'd be happy to try that instead but whatever i try fails.

p.s. i could use matches pattern and have the prompt text tell the user to 'Enter percentage (%), followed by search text followed by percentage(%) e.g. %blah%. that leaves room for user error though...

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Noel Scheaffer Oct 10, 2017 at 04:14 PM

You need to put your wildcards outside of the @Prompt function like this...

tab1.col1 like '%' + @prompt('Enter search text','A',,,) + '%'
10 |10000 characters needed characters left characters exceeded