|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
各位大虾,我后端数据库用的是ORACLE,事实表中有AMT(金额),QTY(数量)2个字段,在提示中我写了个静态提示分别选AMT和QTY,对应到参数为P_M,在BI Publisher我用SQL查询做数据模型,在查询中我写了以下语句
select EDW_DIM_MONTH.YEAR_MONTH_SID as YEAR_MONTH_SID,
EDW_DIM_TERRITORY.BU as BU,
EDW_DIM_TERRITORY.REGN_NAME as REGN_NAME,
decode(:P_M,
'AMT',
sum(EDW_FACT_CONSUMP_ACT_HIST.ACT_AMT),
sum(EDW_FACT_CONSUMP_ACT_HIST.ACT_QTY)) as mm,
sum(EDW_FACT_CONSUMP_ACT_HIST.ACT_AMT) as ACT_AMT,
sum(EDW_FACT_CONSUMP_ACT_HIST.ACT_QTY) as ACT_QTY,
from "Comsumption Sales His".EDW_FACT_CONSUMP_ACT_HIST EDW_FACT_CONSUMP_ACT_HIST,
"Comsumption Sales His".EDW_DIM_TERRITORY EDW_DIM_TERRITORY,
"Comsumption Sales His".EDW_DIM_MONTH EDW_DIM_MONTH
where EDW_FACT_CONSUMP_ACT_HIST.YEAR_MONTH_SID =
EDW_DIM_MONTH.YEAR_MONTH_SID
and EDW_FACT_CONSUMP_ACT_HIST.TERR_SID = EDW_DIM_TERRITORY.TERR_SID
and EDW_DIM_TERRITORY.BU = (:P_BU)
and EDW_DIM_TERRITORY.REGN_DESC in (:P_RM)
and EDW_DIM_MONTH.YEAR_MONTH_SID = (:P_Time)
group by EDW_DIM_MONTH.YEAR_MONTH_SID,
EDW_DIM_TERRITORY.BU,
EDW_DIM_TERRITORY.REGN_NAME
运行报如下错误:java.io.IOException: prepare query failed[nQSError: 27002] Near : Syntax error [nQSError: 26012] .
请问各位,如果要实现这个功能,在BI Publisher要如何写,在Answer里面有如何实现以上功能,谢谢各位。 |
|