博客
关于我
MDX 查询原型
阅读量:802 次
发布时间:2023-02-08

本文共 1670 字,大约阅读时间需要 5 分钟。

记录 SBS 中 MDX 查询原型,供实际项目参考。

  • 查询 2004 年 1 月 2 日 - 2004 年 3 月 1 日之间购买过 Bikes 产品的用户。
  • SELECT ([Product].[Category].[Bikes],[Measures].[Internet Sales Amount]) ON COLUMNS,NON EMPTY [Customer].[Customer].[Customer].MEMBERS ON ROWSFROM [Step-by-Step]WHERE ([Date].[Calendar].[Date].&[20040102]:[Date].[Calendar].[Date].&[20040301])
    1. 查询 2004 年 1 月 2 日 - 2004 年 3 月 1 日之间购买过 Bikes 或 Clothing 产品的用户。
    2. SELECT ({([Product].[Category].[Bikes],[Measures].[Internet Sales Amount]),([Product].[Category].[Clothing],[Measures].[Internet Sales Amount])} ON COLUMNS,NON EMPTY [Customer].[Customer].[Customer].MEMBERS ON ROWSFROM (    SELECT ([Date].[Calendar].[Date].&[20040102]:[Date].[Calendar].[Date].&[20040301]) ON COLUMNS    FROM [Step-by-Step])
      1. 计算 2004 年 3 月 1 日 - 3 月 4 日之前 60 天购买了 Bikes 或 Clothing 产品的用户数量。
      2. WITH MEMBER [Measures].[CustomerCounts] ASCOUNT(NONEMPTY ({[Customer].[Customer].[Customer].MEMBERS},{([Product].[Category].[Bikes],[Measures].[Internet Sales Amount])}* LASTPERIODS(60,[Date].[Calendar].CurrentMember)) + NONEMPTY ({[Customer].[Customer].[Customer].MEMBERS},{([Product].[Category].[Clothing],[Measures].[Internet Sales Amount])}* LASTPERIODS(60,[Date].[Calendar].CurrentMember)) )
        1. 计算每个月第一天到前 60 天购买了 Bikes 或 Clothing 产品的用户数量。
        2. WITH MEMBER [Measures].[CustomerCounts] ASCOUNT(NONEMPTY ({[Customer].[Customer].[Customer].MEMBERS},{([Product].[Category].[Bikes],[Measures].[Internet Sales Amount])}* LASTPERIODS(60,[Date].[Calendar].CurrentMember.FIRSTCHILD)) + NONEMPTY ({[Customer].[Customer].[Customer].MEMBERS},{([Product].[Category].[Clothing],[Measures].[Internet Sales Amount])}* LASTPERIODS(60,[Date].[Calendar].CurrentMember.FIRSTCHILD)) )

          更多 BI 文章请参看相关链接。

    转载地址:http://omyfk.baihongyu.com/

    你可能感兴趣的文章
    NAT-DDNS内网穿透技术,快解析DDNS的优势
    查看>>
    NAT-DDNS内网穿透技术,快解析DDNS的优势
    查看>>
    NAT-DDNS内网穿透技术,解决动态域名解析难题
    查看>>
    natapp搭建外网服务器
    查看>>
    NativePHP:使用PHP构建跨平台桌面应用的新框架
    查看>>
    nativescript(angular2)——ListView组件
    查看>>
    NativeWindow_01
    查看>>
    Native方式运行Fabric(非Docker方式)
    查看>>
    Nature | 电子学“超构器件”, 从零基础到精通,收藏这篇就够了!
    查看>>
    Nature和Science同时报道,新疆出土四千年前遗骸完成DNA测序,证实并非移民而是土著...
    查看>>
    Nat、端口映射、内网穿透有什么区别?
    查看>>
    Nat、端口映射、内网穿透有什么区别?
    查看>>
    nat打洞原理和实现
    查看>>
    NAT技术
    查看>>
    NAT模式/路由模式/全路由模式 (转)
    查看>>
    NAT模式下虚拟机centOs和主机ping不通解决方法
    查看>>
    NAT的两种模式SNAT和DNAT,到底有啥区别?
    查看>>
    NAT的全然分析及其UDP穿透的全然解决方式
    查看>>
    NAT类型与NAT模型详解
    查看>>
    NAT网络地址转换配置实战
    查看>>