mondrian查询语句示例

<jp:mondrianQuery id="query01" jdbcDriver="oracle.jdbc.driver.OracleDriver" jdbcUrl="jdbc:oracle:thin:jbpm/123456@192.168.1.64:1521:orcl" catalogUri="/WEB-INF/queries/nanyang.xml">
with member [时间.时间].[<%=subStr1 %>] as 'Sum(([时间.时间].[全部]<%=subStr4 %> : [时间.时间].[全部]<%=subStr5 %>))'
  member [时间.时间].[<%=subStr1 +"入库"%>] as 'Sum(([时间.时间].[全部]<%=subStr4 %> : [时间.时间].[全部]<%=subStr5 %>))'
  member [时间.时间].[<%=subStr1 +"出库"%>] as 'Sum(([时间.时间].[全部]<%=subStr4 %> : [时间.时间].[全部]<%=subStr5 %>))'
  member [库存机构.库存机构].[合计] as '[库存机构.库存机构].[所有库存机构]'
  member [material num.器材编码].[小计] as '[material num.器材编码].[所有器材编码]'
  member [时间.时间].[<%=beginTime%>] as '[时间.时间].[全部]<%=subStr4 %>'
  member [时间.时间].[<%=endTime%>] as '[时间.时间].[全部]<%=subStr5 %>'
  member [Measures].[期初结余] as '[Measures].[当日结余数量]'
  member [Measures].[期末结余] as '[Measures].[当日结余数量]'
select
 NON EMPTY Union(
  Union(
   Union(
    Crossjoin({[时间.时间].[<%=subStr1 %>]},{[Measures].[单价]}),
    Crossjoin({[时间.时间].[<%=beginTime%>]},{[Measures].[期初结余]})
   ),
   Union(
    Crossjoin(
     {[时间.时间].[<%=subStr1 +"入库"%>]},
     {[Measures].[收料数量], [Measures].[移入数量],[Measures].[直接入库数量], [Measures].[退料(实名制)数量],[Measures].[移出拒收数量],[Measures].[发料拒收数量],[Measures].[入库数量小计]}
    ),
    Crossjoin(
     {[时间.时间].[<%=subStr1 +"出库"%>]},
     {[Measures].[发料数量],[Measures].[移出数量],[Measures].[撤销入库数量],[Measures].[工程领料(实名制)数量],[Measures].[赠品领料(实名制)数量],[Measures].[装机领料(实名制)数量],[Measures].[维护领料(实名制)数量],[Measures].[终端领料(实名制)数量],[Measures].[一般领料(实名制)数量],[Measures].[一般领料(实名制)数量], [Measures].[出库数量小计]}
    )
   )
  ),
  Crossjoin({[时间.时间].[<%=endTime%>]},{[Measures].[期末结余]})
 )ON COLUMNS,
 
 NON EMPTY Union(
   Crossjoin(
    {[库存机构.库存机构].[所有库存机构].Children},{[material num.器材编码].[所有器材编码].Children,[material num.器材编码].[小计]}
   ),
   Crossjoin(
    {[库存机构.库存机构].[合计]},{[material num.器材编码].[小计]}
   )
 ) ON ROWS
from [zancun]

</jp:mondrianQuery>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值