Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to use concat-ids as report-parameter?
iparker
Hello again,
I want to use a report-parameter to get the datasets with special ids, so I set a string-parameter and use it in the query with “WHERE id IN (?)”. But always when I insert some ids separated with a comma (for example "204, 207") I just get the data of the first id.
So where is my error and how can I get datasets with a concat-id-string?
Thanks a lot for a answer!
Timo
Find more posts tagged with
Comments
mwilliams
Hi Timo,<br />
<br />
Take a look at this example:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/devshare/designing-birt-reports/338-birt-parameters-using-in-clause/#description'>BIRT
Parameters - using IN clause - Designs & Code - BIRT Exchange</a><br />
<br />
It sounds like you're trying to do something similar to this, I think. There are several other examples of using multi select parameters in an in clause as well.
iparker
Hello Michael,
Again thanks for your answer. With the following code I add the comma separated ids to my query:
if(params["id_string"].value.indexOf(',') == '-1')
{
this.queryText += ' AND a.id = ' + params["id_string"].value + ' ';
}
else
{
this.queryText += ' AND a.id IN (' + params["id_string"].value + ') ';
}
One more question I have: Do you know the maximum length of a string-parameter?
Timo
mwilliams
Timo,
I'm not sure. If I find anything out, I'll let you know.