Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Using a multi-valued parameter
dji
I have searched the forum, and am surprised not to find information on this. I hope it's not TOO obvious...
I am trying to create a multi-valued parameter, and the parameter creation GUI in BIRT allows this... it provides the List Box type, and there's even a checkbox saying "Allow Multiple Values". But I don't know how to make use of the values that are returned, in my SQL. In fact, in the Parameters section of my data set, there's a warning saying to the effect of "Even if the user chooses multiple values, only the first one will be used."
What the heck? Does BIRT support this, or not? If my parameter data is, say, integers, and I want to do something like this:
WHERE my_int_column in (?)
...to have the ? filled in with multiple values... I see this is problematic as it is, but don't know where to go with it.
Thanks in advance for any help.
Find more posts tagged with
Comments
averma
Hi dji,
This works as a filter in a dataset and not a replacement for "?" in your SQL query. So if you add a filter to the dataset and use the in clause with the parameter as the value it will work.
Ashwini
CBR
Hi,
averma is right. Just want to add that a multi-valued parameter can't be used as a parameter in a query (BIRT doesn't support this feature in the current release). When a parameter supports multiple values you can't select it in the dataSet as parameter value. The only way is to build a string by using javascript and to use this string as a parameter in your query (than it would work as you assumed in your post). This workaround is a very dangerous workaround because it makes it possible to run any query on your database by knowing about the fact that you pass a unchecked string as parameter in your query.
The workaround proposed by averma is the best you can do at the moment
dji
Thanks all, it took a little poking around and experimenting, but I got the filter to work in the way I wanted.