Question

I am using petaho analyzer to view my analysis, which I made in mondrian schema and published it to pentaho ce server: I want to Use the Request Parameter from url in the mdx query. Here is my .xaction file: -

<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>

But the parameter pnId's value remains null in MDX query in spite of it having default value. How to One pass Request parameter from url to this query?

Was it helpful?

Solution

The Where caluse should not be enclosed in {}. and request parameter should be passed in query with {requestparamname}

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top