博客
关于我
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/

    你可能感兴趣的文章
    OBObjective-c 多线程(锁机制) 解决资源抢夺问题
    查看>>
    OBS studio最新版配置鉴权推流
    查看>>
    Obsidian 彩色标题
    查看>>
    Obsidian的使用-ChatGPT4o作答
    查看>>
    Obsidian笔记记录GPT回复的数学公式无缝转化插件Katex to mathjax
    查看>>
    ObsoleteAttribute 可适用于除程序集、模块、参数或返回值以外的所有程序元素。 将元素标记为过时可以通知用户:该元素在产品的未来版本中将被移除。...
    查看>>
    OC block声明和使用
    查看>>
    OC Xcode快捷键
    查看>>
    oc 中的.m和.mm文件区别
    查看>>
    OC 中的重写 OC中没有重载 以及隐藏
    查看>>
    OC 内存管理黄金法则
    查看>>
    oc57--Category 分类
    查看>>
    occi库在oracle官网的下载针对vs2008
    查看>>
    OceanBase 安装使用详细说明
    查看>>
    OceanBase详解及如何通过MySQL的lib库进行连接
    查看>>
    ocp最新题库之052新题带答案整理-36题
    查看>>
    OCP题库升级,新版的052考试题及答案整理-18
    查看>>
    OCR:文字识别(最详细教程)
    查看>>
    OCR使用总结
    查看>>
    OCR识别:身份证信息加密传输
    查看>>