Question

I'm trying to combine multiple members from a single hierarchy, though this leads to the following error:

Query (11, 3) The Jr-Kw-Mnd-Dag hierarchy is used more than once in the Crossjoin function.

This is a basic version of the Query I'm using:

SELECT 
    NON EMPTY { 
        [Measures].[Amount] 
    } ON COLUMNS
    , NON EMPTY { 
        [Realisatiedatum].[Jr-Kw-Mnd-Dag].[Jaar] 
        * [Realisatiedatum].[Jr-Kw-Mnd-Dag].[Maand])
    } ON ROWS

FROM 
    [Cube]

Jaar equals year in English, Maand equals month in English. This is what I'm trying to accomplish:

...
november 2013
december 2013
januari 2014
februari 2014
...

Last but not least, the hierarchy:

enter image description here

Was it helpful?

Solution

I would normally create several hierarchies within the Date dimension, such as Calendar, Financial and others that contain just financial year, calendar year, quarters etc.

If you have another hierarchy that contains the month, you could crossjoin with the year of the hierarchy you are using at the moment; then you won't be using the same hierarchy twice in the crossjoin function.

E.g.

, NON EMPTY { 
  ( [Date Dimension].[Financial].[Financial Year]
    * [Date Dimension].[Calendar].[Month] ) }

OTHER TIPS

If you want to skip some levels in a user hierarchy, the best is to CrossJoin the corresponding attribute hierarchies of the remaining levels.

Here under I use the attribute hierarchy ([Geography].[City].[City], ..) instead of the user hierachy ([Geography].[Geography].[City],..) form the AW cube:

SELECT 
[Measures].[Internet Sales Amount] ON 0,
[Geography].[State-Province].[State-Province] *  [Geography].[City].[City] ON 1 FROM [Adventure Works]

Philip,

This issue is related to trying to pull multiple levels from the same hierarchy using a crossjoin and indeed you cannot. As mentioned in other replies, a good work around is to pull the columns you need from places other than the same hierarchy. But that works only if the cube design allows for it.

Your specific problem may be related to the tool you are using to develop the query and which levels in the hierarchy it returns.

For example, the following query when executed in SQL Server Management Studio (versions through V12.0.2000.8) returns only the City level of the hierarchy. But when executed from within design mode in the PowerPivot table import wizard it returns all levels in the hierarchy down to the city level including Country, State-Province and City.

select 
[Measures].[Internet Order Count] on columns,
non empty [Customer].[Customer Geography].[City] on rows
from [Adventure Works] 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top