0

我必须将字符作为多个值传递(例如:'Products'、'Terms'、'Parts'、....)而不是 id。

在浏览了几篇与在单个参数上传递多个值相关的帖子之后,我在 BIRT 数据集中将我的 sql 编写为

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');

并在打开之前为与 相同的数据集编写脚本,

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

然而我没有得到任何积极的结果。

仅供参考,我使用 spagobi studio(Eclipse 平台版本:Luna SR2 (4.4.2))来创建 BIRT 报告。

我的参数名称是 CategoryLev1。所有参数都定义为文本框,以便我可以将这些参数配置为 spagobi 服务器上的列表框。

谁能帮我吗。谢谢

4

1 回答 1

0

我有一个类似的问题,querytext.replace在为我工作之后放置这个:

this.queryText = this.queryText.replace("''","'");
于 2016-09-28T19:08:19.980 回答