You are on page 1of 6



$QDO\]HUV&DOFXODWHG0HDVXUHVDQG6ROYHB2UGHU3HQWDKR&XVWRPHU6XSSRUW3RUWDO

Customer Portal

Submit a request

Lavakumar Ethamukkala

Search

Pentaho Customer Support Portal > Model and Design > Schema Workbench Design Tool

Analyzers Calculated Measures and Solve_Order


by Carlos Lopez - October 07, 2015 00:31

Follow

Issue:
Analyzers Calculated Measures and Solve Order
Environment:
Pentaho BA Server 4.8.x and up
Resolution:
MDX uses SOLVE_ORDER to deal with multidimensional formula precedence. Every calculated
member has a solve order number defined as an integer that tell Analyzer how to set the
priority to proceed on calculating the values on each calculated member cell.
Take for example the following example using Steel Wheels:
Quantity + 1 Million is created using a user defined number in Analyzer as follows:

KWWSVVXSSRUWSHQWDKRFRPKFHQXVDUWLFOHV$QDO\]HUV&DOFXODWHG0HDVXUHVDQG6ROYH2UGHU





$QDO\]HUV&DOFXODWHG0HDVXUHVDQG6ROYHB2UGHU3HQWDKR&XVWRPHU6XSSRUW3RUWDO

This calculated measure will result on the following report:

The Grand Total cell for the calculated measures shown in red has two competing calculated
members. These two calculated members are listed below with their corresponding MDX as
grabbed from the Analyzer's HTML log file:
Quantity + 1 Million = Solve Order = 0
MDX: MEMBER [Measures].[*CALCULATED_MEASURE_0] AS '[Measures].[Quantity]+1000000',

FORMAT_STRING = '#,##0', SOLVE_ORDER=0


Grand Total = Solve Order = 100
KWWSVVXSSRUWSHQWDKRFRPKFHQXVDUWLFOHV$QDO\]HUV&DOFXODWHG0HDVXUHVDQG6ROYH2UGHU





$QDO\]HUV&DOFXODWHG0HDVXUHVDQG6ROYHB2UGHU3HQWDKR&XVWRPHU6XSSRUW3RUWDO

MDX: MEMBER [Markets].[*TOTAL_MEMBER_SEL~SUM] AS 'SUM([*NATIVE_CJ_SET])',

SOLVE_ORDER=100

Since Grand Total has a higher solve order than Quantity + 1 Million, then the bottom right cell
will be calculated by iterating over each territory and then summing up quantity + 1,000,000
hence resulting on 4,105,331
Checking the Calculate subtotals using formula box, the Quantity + 1 Millions solve order will
be changed from 0 to 200. Now because Quantity + 1 Million has a higher solve order than
Grand Total, then the bottom right cell will be calculated by adding 1,000,000 to the sum of each
territorys quantity.

If you are using Pentaho Schema Workbench to declare your calculated member you can use a
CalculatedMemberProperty to define the solve order:

<CalculatedMember name="Quantity + 1 Million" dimension="Measures">


<Formula>[Measures].[Quantity] + 100000</Formula>
<CalculatedMemberProperty name="FORMAT_STRING"
value="$#,##0.00" />
<CalculatedMemberProperty name="SOLVE_ORDER" value="200" />
</CalculatedMember>

KWWSVVXSSRUWSHQWDKRFRPKFHQXVDUWLFOHV$QDO\]HUV&DOFXODWHG0HDVXUHVDQG6ROYH2UGHU





$QDO\]HUV&DOFXODWHG0HDVXUHVDQG6ROYHB2UGHU3HQWDKR&XVWRPHU6XSSRUW3RUWDO

Another classic example to ilustrate the solve_order is when using Average; the grand total
average can be in two formats:
- The Sum of each lines' average
- The Average of the total

Here is a list of the SOLVE_ORDERS we should apply to calculated measures


to be used by Analyzer

Calculated Member

Solve Order

Purpose

Formatting

500

Used to apply a format string

Numeric Filters

400

Min, Max, Count and Average Totals

300

Smart Measures

200

Sum Totals

100

Used for to apply context for Top N, Greater


than, etc. filters.

Used for subtotals

Used when Calculate subtotal using formula


is checked

Used for subtotals

KWWSVVXSSRUWSHQWDKRFRPKFHQXVDUWLFOHV$QDO\]HUV&DOFXODWHG0HDVXUHVDQG6ROYH2UGHU





$QDO\]HUV&DOFXODWHG0HDVXUHVDQG6ROYHB2UGHU3HQWDKR&XVWRPHU6XSSRUW3RUWDO

Aggregate Totals

-100

Trend Hangar

-200

Slicer

-300

Used for subtotals

Used to apply context for trend user defined


measures

Used to apply slicer filters

For more information on MDX's Solve order please see here

Was this article helpful?

2 out of 2 found this helpful

Have more questions? Submit a request

COMMENTS

Product

Solutions

Services

About Us

Sites

Big Data

Finance

Custom Dashboards

Leadership

Blog

Data Integration

Healthcare

Consulting Services

Partners

Community

Embedded Analytics

Retail

Training

Careers

Documentation

Business Analytics

Government

Certification Program

Media Kit

Wiki

Cloud Analytics

Enterprise

Enterprise Support

Awards

Technical Support

Press Releases

Internet of Things Analytics

Experience Pentaho
Business Analytics
Try Pentaho

(866) 660-7555

News
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy | Sitemap

KWWSVVXSSRUWSHQWDKRFRPKFHQXVDUWLFOHV$QDO\]HUV&DOFXODWHG0HDVXUHVDQG6ROYH2UGHU





$QDO\]HUV&DOFXODWHG0HDVXUHVDQG6ROYHB2UGHU3HQWDKR&XVWRPHU6XSSRUW3RUWDO

Privacy Policy | Legal Notices | Safe Harbor Privacy Policy | Sitemap


Copyright 2005 - 2015 Pentaho Corporation. All Rights Reserved

KWWSVVXSSRUWSHQWDKRFRPKFHQXVDUWLFOHV$QDO\]HUV&DOFXODWHG0HDVXUHVDQG6ROYH2UGHU



You might also like