"The dimension '<named set alias>' was not found in the cube when the string, <named set alias>, was parsed" error when you execute an MDX query in SQL Server 2012 Analysis Services

Article translations Article translations
Article ID: 2739928 - View products that this article applies to.
Expand all | Collapse all

On This Page

Symptoms

When you try to run a Multidimensional Expressions (MDX) query in Microsoft SQL Server 2012 Analysis Services (SSAS), you receive an error message that resembles the following:
The dimension '<named set alias>' was not found in the cube when the string, <named set alias>, was parsed.

Notes
  • "Named set alias" is a placeholder for the dynamic name that you defined for the dimension.
  • The MDX query is executed successfully in SSAS 2008 R2.

For example, you receive the error message when you execute the following query against the AdventureWorks SQL Server 2008 R2 database in SSAS 2012:
WITH 
SET XQE_NS10 AS
Filter
(
[Product].[Product Categories].[Category].MEMBERS
,
Count
(
Filter
(
CrossJoin
(
[Product].[Product Categories].[Category].MEMBERS
,[Product].[Status].[Status].MEMBERS
)
,
(
[Measures].[Reseller Freight Cost]
,[Date].[Fiscal].[XQE_MDF_CM0]
)
> 20000
)
,IncludeEmpty
)
> 0
)


/* The named set [XQE_SA0] is defined in context of the COUNT operation */

MEMBER [Date].[Fiscal].[XQE_MDF_CM0] AS
IIF
(
Count
(
Descendants
(
[Geography].[Geography].CurrentMember
,[Geography].[Geography].[Country]
) AS [XQE_SA0]
,IncludeEmpty
)
> 0
,Aggregate

/* [XQE_SA0] is subsequently used in AGGREGATE */
(
[XQE_SA0]
,[Date].[Fiscal].DefaultMember
)
,NULL
)
SET XQE_NS0 AS
[Geography].[Geography].[Country].&[Canada]
SELECT
{XQE_NS0} ON 0
FROM [AdventureWorks]
WHERE
[Measures].[Reseller Freight Cost];

Cause

This issue occurs because an alias that is defined in a specific scope cannot be referenced outside the scope in SSAS 2012.

Note The scope leak is enabled in SSAS 2008 R2. However, it is disabled in SSAS 2012.

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Workaround

To work around this issue, use one of the following methods to avoid referencing an alias that is outside its defined scope in an MDX query in SSAS 2012.

Method 1

Reference the alias within its defined scope.

Method 2

Use a duplicate MDX expression that represents the alias. For example, to work around the problem in the situation described in the "Symptoms" section, you can replace the [XQE_SA0] alias with the following expression:
([Geography].[Geography].CurrentMember,[Geography].[Geography].[Country])
Now, the following code will run successfully:
WITH 
SET XQE_NS10 AS
Filter
(
[Product].[Product Categories].[Category].MEMBERS
,
Count
(
Filter
(
CrossJoin
(
[Product].[Product Categories].[Category].MEMBERS
,[Product].[Status].[Status].MEMBERS
)
,
(
[Measures].[Reseller Freight Cost]
,[Date].[Fiscal].[XQE_MDF_CM0]
)
> 20000
)
,IncludeEmpty
)
> 0
)
MEMBER [Date].[Fiscal].[XQE_MDF_CM0] AS
IIF
(
Count
(
Descendants
(
[Geography].[Geography].CurrentMember
,[Geography].[Geography].[Country]
) AS [XQE_SA0]
,IncludeEmpty
)
> 0
,Aggregate
(
Descendants
/* instead of referencing [XQE_SA0], substitute the MDX upon which it is based */
(
[Geography].[Geography].CurrentMember
,[Geography].[Geography].[Country]
)
,[Date].[Fiscal].DefaultMember
)
,NULL
)
SET XQE_NS0 AS
[Geography].[Geography].[Country].&[Canada]
SELECT
{XQE_NS0} ON 0
FROM [AdventureWorks]
WHERE
[Measures].[Reseller Freight Cost];

References

For more information about the AdventureWorks database for SQL Server 2008 R2, go to the following Microsoft CodePlex website:
Microsoft SQL Server Product Samples

Properties

Article ID: 2739928 - Last Review: November 19, 2012 - Revision: 2.0
Applies to
  • Microsoft SQL Server 2012 Developer
  • Microsoft SQL Server 2012 Enterprise
  • Microsoft SQL Server 2012 Standard
  • Microsoft SQL Server 2012 Business Intelligence
  • Microsoft SQL Server 2012 Web
Keywords: 
kbtshoot kbsurveynew kbexpertiseadvanced KB2739928

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com