MDX SSAS-测量中的最大日期 [英] MDX SSAS - Max Date in Measure

查看:122
本文介绍了MDX SSAS-测量中的最大日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只需在我的多维数据集中的所有度量中获取MAX日期即可.例如,DateIDDimention[Measure].[First Measure],...,...,[Second Measure].

如何从多维数据集中的所有度量获取MAX(DateID)列表.

解决方案

以下内容将为您提供与每个度量值关联的最大日期值...但是您将必须手动创建与每个度量值相对应的计算所得成员.

>

WITH
    MEMBER [Measures].[Max Date - Internet Sales Amount] AS
        TAIL(
            NONEMPTY(
                [Date].[Date].[Date]
                ,[Measures].[Internet Sales Amount]
            )
            ,1
        ).Item(0).MemberValue
    MEMBER [Measures].[Max Date - Reseller Sales Amount] AS
        TAIL(
            NONEMPTY(
                [Date].[Date].[Date]
                ,[Measures].[Reseller Sales Amount]
            )
            ,1
        ).Item(0).MemberValue
SELECT
    {
        [Measures].[Max Date - Internet Sales Amount],
        [Measures].[Max Date - Reseller Sales Amount]
    } ON 0
FROM
    [Adventure Works]

如果要获取多维数据集中所有度量的单个最大日期,则需要采用其他方法.

Just need to get MAX date in ALL my Measures in the Cube. For instance, DateID is a Dimention, [Measure].[First Measure],...,...,[Second Measure].

How to get list of MAX(DateID) from all Measures in my Cube.

解决方案

The following will get you the max date value associated with each measure...but you will have to manually create a calculated member corresponding to each measure.

WITH
    MEMBER [Measures].[Max Date - Internet Sales Amount] AS
        TAIL(
            NONEMPTY(
                [Date].[Date].[Date]
                ,[Measures].[Internet Sales Amount]
            )
            ,1
        ).Item(0).MemberValue
    MEMBER [Measures].[Max Date - Reseller Sales Amount] AS
        TAIL(
            NONEMPTY(
                [Date].[Date].[Date]
                ,[Measures].[Reseller Sales Amount]
            )
            ,1
        ).Item(0).MemberValue
SELECT
    {
        [Measures].[Max Date - Internet Sales Amount],
        [Measures].[Max Date - Reseller Sales Amount]
    } ON 0
FROM
    [Adventure Works]

If you want to get the single max date across all measures in the cube, you'll need to take a different approach.

这篇关于MDX SSAS-测量中的最大日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆