11

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!

4

1 回答 1

17

您不能在列和切片器上使用期间层次结构。

您可以像这样重写您的查询:

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]]
)
于 2012-10-18T21:57:24.793 回答