Usage Note 40007: Understanding solve order in SAS OLAP cubes
Solve order specification is defined in MDX Solutions: With Microsoft SQL Server Analysis Services by George Spofford as
A higher number indicates that the member is calculated using the values that result from the calculations that have a lower number.
So, by adjusting the value of the SOLVE_ORDER option in your OLAP calculated members (see
DEFINE Statement), you can control the precedence of the calculations.
In some cases, it is important to determine whether the values should be totalled and the calculation applied to that total result, or whether the calculation should be applied to the values, and the results are included in the total. The predefined solve_order for the VisualTotals function is −4096, which is important when determining the order of your calculations.
In the following example, the calculation being performed is <value> + 100000:
WITH
MEMBER [Measures].[My Calculation] AS
[Measures].[ActualSum] + 100000, SOLVE_ORDER = -5000
SELECT
{[Measures].[ActualSum], [Measures].[My Calculation]} ON COLUMNS,
VISUALTOTALS(ADDPARENTS([Geography].[Country].MEMBERS, POST), "Total *") ON ROWS
FROM
[SalesCube]
|
The calculated measure is executed before the visual totals (−4096), which means that, for every measure, 100000 is added to it and then these values are totaled.
The following query and results demonstrate what happens when solve order is not applied, using the default value of 0 instead.
WITH
MEMBER [Measures].[My Calculation] AS
[Measures].[ActualSum] + 100000
SELECT
{[Measures].[ActualSum], [Measures].[My Calculation]} ON COLUMNS,
VISUALTOTALS(ADDPARENTS([Geography].[Country].MEMBERS, POST), "Total *") ON ROWS
FROM
[SalesCube]
|
In this case, the measures are totaled first and then the calculated measure is applied to add 100000 to it.
Operating System and Release Information
SAS System | SAS OLAP Server | z/OS | 9.2 TS2M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS2M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS2M0 | |
Microsoft® Windows® for x64 | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 for x64 | 9.2 TS2M0 | |
Microsoft Windows Server 2008 for x64 | 9.2 TS2M0 | |
Microsoft Windows XP Professional | 9.2 TS2M0 | |
Windows Vista | 9.2 TS2M0 | |
Windows Vista for x64 | 9.2 TS2M0 | |
64-bit Enabled AIX | 9.2 TS2M0 | |
64-bit Enabled HP-UX | 9.2 TS2M0 | |
64-bit Enabled Solaris | 9.2 TS2M0 | |
HP-UX IPF | 9.2 TS2M0 | |
Linux | 9.2 TS2M0 | |
Linux for x64 | 9.2 TS2M0 | |
OpenVMS on HP Integrity | 9.2 TS2M0 | |
Solaris for x64 | 9.2 TS2M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Usage Note |
Priority: | |
Topic: | Query and Reporting ==> OLAP (Online Analytical Processing)
|
Date Modified: | 2010-06-22 10:01:35 |
Date Created: | 2010-06-16 09:32:16 |