Pentaho分析Xaction编辑

时间:2014-01-07 11:57:09

标签: pentaho olap

我正在使用petaho分析器查看我的分析,我在mondrian模式中制作并将其发布到pentaho ce服务器: 我想在mdx查询中使用来自url的请求参数。 这是我的.xaction文件: -

<action-sequence> 
  <title>PTCR</title>  
  <version>1</version>  
  <logging-level>debug</logging-level>  
  <documentation> 
    <author>KuldeepSChauhan</author>  
    <help/>  
    <result-type>report</result-type>  
    <description>PTCR</description>  
    <icon/>  
    <!-- need an icon --> 
  </documentation>  
  <inputs> 
      <pnId type="string">
      <sources> 
        <request>pnId</request> 
      </sources>
<default-value>134</default-value>    
    </pnId>  
    <mode type="string"> 
      <default-value/>  
      <sources> 
        <request>mode</request> 
      </sources> 
    </mode> 
  </inputs>  
  <outputs> 
    <model type="string"/>  
    <connection type="string"/>  
    <mdx type="string"/>  
    <options type="list"/>  
    <title type="string"/>  
    <url type="string"> 
      <destinations> 
        <response>redirect</response> 
      </destinations> 
    </url> 
  </outputs>  
  <resources/>  
  <actions>     
    <action-definition> 
      <component-name>PivotViewComponent</component-name>  
      <action-type>Pivot View</action-type>  
      <action-inputs> 
      <pnId type="string" mapping="pnId"/>
        <mode type="string"/>          
      </action-inputs>  
      <action-outputs> 
        <model type="string"/>  
        <connection type="string"/>  
        <mdx type="string"/>  
        <options type="list"/>  
        <title type="string"/>  
        <url type="string"/> 
      </action-outputs>  
      <component-definition> 
        <title>Drill Down to Pivot Table</title>  
        <viewer>Pivot</viewer>  
        <model><![CDATA[solution:/S3IV2/PTCR.xml]]></model>  
        <options> 
          <personal/>  
          <cube-nav/>  
          <mdx-edit/>  
          <sort-conf/>  
          <spacer/>  
          <level-style/>  
          <hide-spans/>  
          <properties/>  
          <non-empty/>  
          <swap-axes/>  
          <spacer/>  
          <drill-member/>  
          <drill-position/>  
          <drill-replace/>  
          <drill-thru/>  
          <spacer/>  
          <chart/>  
          <chart-conf/>  
          <spacer/>  
          <print-conf/>  
          <print-pdf/>  
          <spacer/>  
          <excel/> 
        </options>  
        <query><![CDATA[select NON EMPTY {[Measures].[Coupon Value]} ON COLUMNS,
  NON EMPTY {([TERITORRY NAME].[All Territories], [PRODUCT NAME].[All PRODUCTS])} ON ROWS
from [PTCR]
where {[RULE NAME].[{pnId}]}

]]></query> 
        <jndi><![CDATA[S3IV2]]></jndi>  
        <cube>PTCR</cube>
      </component-definition>  
      <action-name>Pivot View</action-name>  
      <logging-level>DEBUG</logging-level> 
    </action-definition> 
  </actions> 
</action-sequence>

但是参数pnId的值在MDX查询中仍然为空,尽管它具有默认值。 如何将URL中的Request参数传递给此查询?

1 个答案:

答案 0 :(得分:0)

Where子句不应包含在{}中。 和请求参数应该在{request param name}

的查询中传递