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)
Passing Multiple values On Single Parameter
Abdur Rahmaan
<p>Hi,</p>
<p> </p>
<p>After going through several posts related to passing multiple values on a single parameter, i wrote my sql in the BIRT dataset as <span style="color:#ff0000;">select m.country,tp.categoryLev1 ,tp.categoryLev2,m.sentiment,<br>
(case when m.sentiment=1 then 'S1' when m.sentiment=2 then 'S2'<br>
when m.sentiment=3 then 'S3' when m.sentiment=4 then 'S4' end) as rating<br>
from mentionmysql.topic tp<br>
join mentionmysql.master m on m._id=tp._id<br>
where m.Country like ? and </span><span style="color:#0000ff;">tp.categoryLev1 IN ('****')</span><br><span style="color:#ff0000;">and m.MentionCreatedDate between str_to_date(?,'%d/%m/%Y') and str_to_date(?,'%d/%m/%Y');</span><br>
and wrote the script for before open for the same dataset as ,</p>
<p> </p>
<p><span style="color:#ff0000;">this.queryText = this.queryText.replace("****", params["CategoryLev1"].value.join(","));</span></p>
<p> </p>
<p>Yet i did not get any positive result.</p>
<p>FYI I use spagobi studio (Eclipse Platform Version: Luna SR2 (4.4.2)) for creating BIRT report.</p>
<p> </p>
<p>My parameter name is <span style="color:#0000ff;">CategoryLev1</span>. All parameters are defined as text box so that I can configure these parameters as list box on spagobi server.</p>
<p> </p>
<p>can anyone help me out. Thanks</p>
Find more posts tagged with
Comments
Abdur Rahmaan
<p>Has anybody solution for this ?. Please inform me as it is very urgent. FYI i need to pass characters as multiple values (for eg: 'Products','Terms','Parts',....) and not id's.</p>
pricher
<p>Hi,</p>
<p> </p>
<p>The statement</p>
<p> </p>
<p><span style="color:rgb(255,0,0);font-family:'Source Sans Pro', sans-serif;">this.queryText = this.queryText.replace("****", params["CategoryLev1"].value.join(","));</span></p>
<p> </p>
<p>works only when the report parameter is defined as a List, a Combo Box, or a Radio Button. In this case, the parameter values are returned as an array and the "join" method is used to convert the array into a list.</p>
<p> </p>
<p>Instead, try using</p>
<p> </p>
<p><span style="color:#ff0000;">this.queryText = this.queryText.replace("'****'", params["<span style="font-family:'Source Sans Pro', sans-serif;">CategoryLev1</span>"].value);</span></p>
<p> </p>
<p>Notice also that you need to replace <span style="color:#ff0000;">'****'</span>, not just <span style="color:#ff0000;">****</span>.</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
Abdur Rahmaan
<p>Thanks a lot. It is working now..</p>
simbam
<p><strong>I found out the solution to this problem is </strong></p>
<p> </p>
<p><span style="color:#000000;">select m.country,tp.categoryLev1 ,tp.categoryLev2,m.sentiment,<br>
(case when m.sentiment=1 then 'S1' when m.sentiment=2 then 'S2'<br>
when m.sentiment=3 then 'S3' when m.sentiment=4 then 'S4' end) as rating<br>
from mentionmysql.topic tp<br>
join mentionmysql.master m on m._id=tp._id</span><br><span style="color:#ee82ee;">where m.Country like ? and tp.categoryLev1 IN ("****") </span><br><span style="color:#000000;">and m.MentionCreatedDate between str_to_date(?,'%d/%m/%Y') and str_to_date(?,'%d/%m/%Y');</span></p>
<p> </p>
<p><span style="color:#0000ff;"><strong>1.// place (****) place holder in double quotes "" </strong></span></p>
<p> </p>
<p><span style="color:#0000ff;"><strong>2.in the script beforeOpen()</strong></span></p>
<p> </p>
<p><span style="color:#0000ff;">this.queryText = this.queryText.replace('"****"', params["<span style="color:#ee82ee;">categoryLev1</span>"].value);</span></p>
<p> </p>
<p> have your quotes like this <span style="color:#ff0000;">'</span><span style="color:#0000cd;"> "</span><span style="color:#ff0000;">****</span><span style="color:#0000cd;">"</span><span style="color:#ff0000;">'</span> and make sure parameter <span style="color:#0000ff;"><span style="color:#ee82ee;">categoryLev1</span></span> is a textbox</p>