Search code examples
ssasssas-2008ssas-2012

Two sets specified in the function have different dimensionality


I have a basic query and having trouble understand exactly what this error means.

Select {[Dim Date].[Date].[Date],[Measures].[Quantity]} on columns
from 
[AcoEdsv]

Solution

  • It's not error, but wrong query.

    I believe error is:

    Members, tuples or sets must use the same hierarchies in the function.

    In other words, Set and Member used as a Set.

    [Dim Date].[Date].[Date] - it's a set of Level Date's members. E.g. {2/1/2015, 2/2/2015, 2/3/2015} and so on.

    [Measures].[Quantity] - it's a member Quantity of special dimension Measures.

    Here is list of fails in your query and possible solutions:

    1) [Measures].[Quantity] should be on another axis (e.g. , [Measures].[Quantity] on rows)

    Select {[Dim Date].[Date].[Date]} on columns
    ,[Measures].[Quantity] on rows
    from
    [AcoEdsv]
    

    2) Or you're trying to use aggregation function without determining itself. Let's say SUM:

    with member [Measures].[Test]
    as SUM({[Dim Date].[Date].[Date]},[Measures].[Quantity])
    
    Select {[Dim Date].[Date].[Date]} on columns
    ,[Measures].[Test] on rows
    from 
    [AcoEdsv]