Abdur Rahmaan
Abdur Rahmaan

Reputation: 29

SpagoBI Studio Passing Strings as Multivalue Parameter

I have to pass characters as multiple values (for eg: 'Products','Terms','Parts',....) and not id's.

After going through several posts related to passing multiple values on a single parameter, i wrote my sql in the BIRT dataset as

select m.country,tp.categoryLev1 ,tp.categoryLev2,m.sentiment,
(case when m.sentiment=1 then 'S1' when m.sentiment=2 then 'S2'
when m.sentiment=3 then 'S3' when m.sentiment=4 then 'S4' end) as rating
from mentionmysql.topic tp
join mentionmysql.master m on m._id=tp._id
where m.Country like ? and tp.categoryLev1 IN ('xxx')
and m.MentionCreatedDate 
between str_to_date(?,'%d/%m/%Y') and str_to_date(?,'%d/%m/%Y');

and wrote the script for before open for the same dataset as ,

this.queryText =      this.queryText.replace("xxx",params["CategoryLev1"].value.join(","));

Yet i did not get any positive result.

FYI I use spagobi studio (Eclipse Platform Version: Luna SR2 (4.4.2)) for creating BIRT report.

My parameter name is CategoryLev1. All parameters are defined as text box so that I can configure these parameters as list box on spagobi server.

can anyone help me out. Thanks

Upvotes: 0

Views: 353

Answers (1)

Adonai Seixas
Adonai Seixas

Reputation: 11

I had a similar problem, placing this after querytext.replace worked for me:

this.queryText = this.queryText.replace("''","'");

Upvotes: 0

Related Questions