If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

text box prompt

Started by mprof, 19 Dec 2013 04:59:33 AM

Previous topic - Next topic

mprof

can i put multiple values into a text box prompt?

for example:

I would like to enter the values: 5,7,23. into a prompt box (parameter is par1)

and the query is

select price from groceries
where id in ((#prompt('par1')#)).

I want the query to be:
select proce from groceries
where in in (5,7,23).

can i do this way?

thanks
Michael

MFGF

Hi,

Assuming ID is numeric, this should work:

select price from groceries
where id in (#prompt('par1','token','1')#)

MF.
Meep!

mprof

thanks a lot  :)

is there maybe a way to do the same but with string values?
let's say... 'orange','soap','tomato'

thanks

MFGF

Let's take a step back for a moment. Why would you want to get users to manually type things like this into a text box prompt (with the huge risk they could mis-spell a value or even enter something that doesn't exist)? Wouldn't a value prompt be far more friendly? Is there any particular reason why you are manually coding SQL anyway rather than defining a simple filter in the report?

Cheers!

MF.

Meep!

mprof

actually this demand came from the users.
the have a list of several thousand items, and they want to choose only several of them in one query (for example 10 different items).
to give them a multiple choice is not very useful because the items are different each time and to search for them in the list takes to much time.
I'm aware that they may misspell or make other mistakes, but it is the most dynamic solution I could think of.

mprof

is there a way to do so in report studio directly without using sql coding?

MFGF

How about a Select and Search prompt? Users enter all or part of a name and choose one or more items from the list of hits. They can then search for something else and choose some more...

That surely has to be better than relying on them to type in accurate names?

You don't need SQL - just add a detail filter coded with an expression of [Item name] in ?Some Parameter name of your choice?

Cheers!

MF.
Meep!