Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Using "REGION" or "DEPARTMENT" in MDX Queries

  1. #1
    Join Date
    Feb 2008
    Posts
    1

    Default Using "REGION" or "DEPARTMENT" in MDX Queries

    Hi all
    I want to write a MDX query in my department_variance_data.xaction file,and I want to use the parameter"REGION" in my query,How do I write the query sentence?

    part of my department_variance_data.xaction:

    <inputs>
    <REGION type="string">
    <sources>
    <request>REGION</request>
    </sources>
    </REGION>
    </inputs>

    <outputs>
    <rule-result type="result-set"/>
    </outputs>

    <resources>
    <catalog>
    <url>
    <location>samples/reporting/enesys.mondrian.xml</location>
    <mime-type>text/xml</mime-type>
    </url>
    </catalog>
    </resources>

    <actions>
    <action-definition>
    <component-name>MDXLookupRule</component-name>
    <action-type>OLAP Query For Report Data</action-type>
    <action-resources>
    <catalog type="resource"/>
    </action-resources>
    <action-outputs>
    <query-results type="result-set" mapping="rule-result"/>
    </action-outputs>
    <component-definition>
    <jndi>enesysdb</jndi>
    <location>mondrian</location>
    <query><![CDATA[select NON EMPTY {[Measures].[cost]} ON COLUMNS,
    ([company].[(I want to put the REGION here)].Children) ON ROWS
    from [enesyscube]]]></query>
    </component-definition>
    </action-definition>


    </actions>
    Thanks.

    Adrian

  2. #2

    Default

    Try this:


    <query><![CDATA[select NON EMPTY {[Measures].[cost]} ON COLUMNS,
    ([company].[({REGION})].Children) ON ROWS
    from [enesyscube]]]></query>



    The "{ }" means you want to use a value from a variable.
    The "REGION" inside the "{ }" is the variable "REGION" you've just defined as input in the <inputs> tag.

    Hope this works! Cheers!
    Last edited by roren; 03-19-2008 at 02:52 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.