<?xml version="1.0" encoding="UTF-8"?>
<action-sequence> 
  <name>MDX_Datasource.xaction</name>
  <title>An MDX Datasource</title>
  <version>1</version>
  <logging-level>debug</logging-level>
  <documentation> 
    <author>William Seyler</author>  
    <description>Exercises the MDX Connection</description>  
    <help/>  
    <result-type>rule</result-type>  
  </documentation>

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

  <resources> 
    <catalog> 
      <solution-file> 
        <location>SampleData.mondrian.xml</location>  
        <mime-type>text/xml</mime-type> 
      </solution-file> 
    </catalog> 
  </resources>
  
  <actions> 
    <action-definition> 
      <component-name>MDXLookupRule</component-name>
      <action-type>Query For OLAP 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>SampleData</jndi>
        <location>mondrian</location>  
        <query><![CDATA[with member [Measures].[Variance Percent] as '([Measures].[Variance] / [Measures].[Budget])', format_string = IIf(((([Measures].[Variance] / [Measures].[Budget]) * 100.0) > 2.0), "|#.00%|style='green'", IIf(((([Measures].[Variance] / [Measures].[Budget]) * 100.0) < 0.0), "|#.00%|style='red'", "#.00%"))
select Crossjoin({[Region].[All Regions].[Central], [Region].[All Regions].[Eastern], [Region].[All Regions].[Southern], [Region].[All Regions].[Western]}, {[Measures].[Actual], [Measures].[Budget]}) ON columns,
  Hierarchize(Union({[Department].[All Departments]}, [Department].[All Departments].Children)) ON rows
from [Quadrant Analysis]]]></query> 
      </component-definition> 
    </action-definition>
 
  </actions> 
</action-sequence>