Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MDX Error "Hierarchy already appears in the Axis0 axis"

Tags:

mdx

In the following MDX queries

SELECT 
{
    [EffectiveDate].[Period].[All].CHILDREN, 
    [EffectiveDate].[Period].[All]
} ON COLUMNS, 
NON EMPTY {
    [Account].[Hierarchy].[Account Type].&[Assets].CHILDREN,
    [Account].[Hierarchy].[Account Type].&[Assets],
    [Account].[Hierarchy].[Account Type].&[Liabilities].CHILDREN,
    [Account].[Hierarchy].[Account Type].&[Liabilities],
    [Account].[Hierarchy].[Account Type].&[Equity].CHILDREN, 
    [Account].[Hierarchy].[Account Type].&[Equity],
    [Account].[Hierarchy].[Account Type].&[Revenue].CHILDREN, 
    [Account].[Hierarchy].[Account Type].&[Revenue],
    [Account].[Hierarchy].[Account Type].&[Expenses].CHILDREN,
    [Account].[Hierarchy].[Account Type].&[Expenses]
} ON ROWS 
FROM [JEMDA] 
WHERE CrossJoin(
    {
        [Measures].[Amount]
    }, 
    {
        [Source].[Source].[[Blank]]]
    }, 
    {
        [EffectiveDate].[Period].&[5-Dec],
        [EffectiveDate].[Period].&[5-Nov],
        [EffectiveDate].[Period].&[5-Oct],
        [EffectiveDate].[Period].&[6-Jan]
    })

It reports the error:

The Period hierarchy already appears in the Axis0 axis.

Can you tell me how to solve this issue? Thanks!

like image 924
user1750761 Avatar asked Oct 18 '12 21:10

user1750761


1 Answers

You cannot use the Period hierarchy on columns AND on the slicer.

You may rewrite your query like this:

SELECT 
{
    [EffectiveDate].[Period].[All].CHILDREN, 
    [EffectiveDate].[Period].[All]
} ON COLUMNS, 
NON EMPTY 
{
    [Account].[Hierarchy].[Account Type].&[Assets].CHILDREN,
    [Account].[Hierarchy].[Account Type].&[Assets],
    [Account].[Hierarchy].[Account Type].&[Liabilities].CHILDREN,
    [Account].[Hierarchy].[Account Type].&[Liabilities],
    [Account].[Hierarchy].[Account Type].&[Equity].CHILDREN, 
    [Account].[Hierarchy].[Account Type].&[Equity],
    [Account].[Hierarchy].[Account Type].&[Revenue].CHILDREN, 
    [Account].[Hierarchy].[Account Type].&[Revenue],
    [Account].[Hierarchy].[Account Type].&[Expenses].CHILDREN,
    [Account].[Hierarchy].[Account Type].&[Expenses]
} ON ROWS 
FROM
 (
    SELECT {
                [EffectiveDate].[Period].&[5-Dec],
                [EffectiveDate].[Period].&[5-Nov],  
                [EffectiveDate].[Period].&[5-Oct],
                [EffectiveDate].[Period].&[6-Jan]
            } ON 0
  FROM [JEMDA]
)
WHERE 
(
[Measures].[Amount], 
[Source].[Source].[[Blank]]
)
like image 96
Benoit Avatar answered Jan 01 '23 21:01

Benoit