【问题标题】:Using MDX Correlation() function to find correlation of 2 dimentional members使用 MDX Correlation() 函数查找二维成员的相关性
【发布时间】:2011-05-01 00:26:45
【问题描述】:

我试图找到一个维度的两个成员之间单个度量的 Pearson 相关性,但 msdn docs 有点稀疏。具体来说,我有一个具有fact count 度量、date 维度和tool 维度的多维数据集,我想找到工具 X 和工具 Y 在日期维度上的相关性。

【问题讨论】:

    标签: statistics ssas mdx


    【解决方案1】:

    看看下面的脚本(Adventure Works DW 2008 R2):

    它将返回两个不同产品子类别(“Mountain Bikes”/“RoadBikes”)的 [Internet Sales Amount] 度量的相关性,用于行中当前日期成员的月份(日历年 2007 季度和日历年 2007)。我在 cmets 中留下了其他可比较的成员。

    with 
    member ActualMeasure    AS  [Measures].[Internet Sales Amount]
    
    member m1 AS 
    (
        [Product].[Product Categories].[Subcategory].&[1] -- Mountain Bikes
    --  [Sales Territory].[Sales Territory].[Group].&[North America]
    --  [Customer].[Gender].&[F]
        ,ActualMeasure
    )
    member m2 AS 
    (
        [Product].[Product Categories].[Subcategory].&[2] -- Road Bikes
    --  [Sales Territory].[Sales Territory].[Group].&[Europe]
    --  [Customer].[Gender].&[M]
        , ActualMeasure
    )
    member x as
    Correlation
    (
        {Descendants([Date].[Calendar].CurrentMember,[Date].[Calendar].[Month]) } as dates
        , m1
        , m2
    ), Format_String="Standard"
    
    select
    {   x,m1,m2 } on 0,
    {
        Descendants
        (
            [Date].[Calendar].[Calendar Year].&[2007]
            , [Date].[Calendar].[Calendar Quarter]
        )  
        ,[Date].[Calendar].[Calendar Year].&[2007]
    } on 1
    from [Adventure Works]
    

    HTH,

    赫尔沃耶·皮亚塞沃利

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-29
      • 2015-02-17
      • 1970-01-01
      相关资源
      最近更新 更多