MDX获取详细信息

时间:2014-02-04 11:06:16

标签: mdx

如何根据此查询获取总数以及详细信息?它与此相似但更复杂。 ssas 2005 mdx get total

    select 

    {
    [Measures].[Promo sold value]
    ,[Measures].[Promo units]
    ,[Measures].[Promo baskets]
    ,[Measures].[Promo ATV]
    ,[Measures].[Promo AUT]
    ,[Measures].[Promo discount]
    } ON COLUMNS

    , 
    non empty
    [Branch].[Branch].[Branch]
    *[Branch].[Branch Code].[Branch Code]
    *[Time].[Finacial year].[Finacial year]
    *{
    [Time].[Finacial week no].&[27]&[12]
    ,[Time].[Finacial week no].&[28]&[12]
    ,[Time].[Finacial week no].&[29]&[12]
    ,[Time].[Finacial week no].&[30]&[12]
    ,[Time].[Finacial week no].&[31]&[12]
    }
    *{
        [Promotions].[Promotion].[a] 
        ,[Promotions].[Promotion].[b]
    }

    on rows
    from [Rmis]

enter image description here

1 个答案:

答案 0 :(得分:0)

您可以使用与您引用的查询类似的内容:

WITH set [weeks] as 
    {
    [Time].[Finacial week no].&[27]&[12]
    ,[Time].[Finacial week no].&[28]&[12]
    ,[Time].[Finacial week no].&[29]&[12]
    ,[Time].[Finacial week no].&[30]&[12]
    ,[Time].[Finacial week no].&[31]&[12]
    }
    set [promos] as
    {
    [Promotions].[Promotion].[a] 
    ,[Promotions].[Promotion].[b]
    }
    member [Time].[Finacial week no].[Total] as
    Aggregate([weeks])
    member [Promotions].[Promotion].[Total] as
    Aggregate([promos])
SELECT 
{
[Measures].[Promo sold value]
,[Measures].[Promo units]
,[Measures].[Promo baskets]
,[Measures].[Promo ATV]
,[Measures].[Promo AUT]
,[Measures].[Promo discount]
} ON COLUMNS
, 
non empty
{(
 [Branch].[Branch].[All],
 [Branch].[Branch Code].[All],
 [Time].[Finacial year].[All],
 [Time].[Finacial week no].[Total],
 [Promotions].[Promotion].[Total]
)}
+
(
[Branch].[Branch].[Branch]
*[Branch].[Branch Code].[Branch Code]
*[Time].[Finacial year].[Finacial year]
*[weeks]
*[promos]
)
on rows
from [Rmis]

根据您的维度配置,您可能需要调整All成员的名称。