ssas 2005 mdx get total

╄→гoц情女王★ 提交于 2019-12-11 19:40:04

问题


I have this MDX query

    select 
    {
        [Measures].[Sold value]
        ,[Measures].[Units]
        ,[Measures].[Sales baskets]
        ,[Measures].[ATV]
        ,[Measures].[AUT] 
    } on columns

    , filter(
        nonempty(
            {[Branch].[Branch].&[5] *[Receipt No - Sales].[Receipt No].[Receipt No]}
        ),
        [Measures].[Sold value] >= 50
    ) on rows
    from Rmis
    where [Time].[Day].&[20131218]

Which generates following result:

How can I get the total of these measures of the above result set? The total should use the aggregation defined in the cube.


回答1:


with set [rows] as
    filter(
        nonempty(
            {[Branch].[Branch].&[5] *[Receipt No - Sales].[Receipt No].[Receipt No]}
        ),
        [Measures].[Sold value] >= 50
    )

    member [Receipt No - Sales].[Receipt No].[Total] as
    aggregate([rows])

select 
    {
        [Measures].[Sold value]
        ,[Measures].[Units]
        ,[Measures].[Sales baskets]
        ,[Measures].[ATV]
        ,[Measures].[AUT] 
    } on columns
    ,
    { ([Branch].[Branch].&[5], [Receipt No - Sales].[Receipt No].[Total]) }
    +
    [rows]
    on rows
    from Rmis
    where [Time].[Day].&[20131218]


来源:https://stackoverflow.com/questions/20687937/ssas-2005-mdx-get-total

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!