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

    你可能感兴趣的文章
    oracle常见错误
    查看>>
    Oracle并行
    查看>>
    oracle数据库 添加定时器
    查看>>
    Oracle数据库入门——初级系列教程
    查看>>
    oracle数据库包package小例子
    查看>>
    UBUNTU 添加删除用户
    查看>>
    Oracle数据库备份与还原
    查看>>
    Ubuntu Seata开机自启动服务
    查看>>
    uart 驱动架构
    查看>>
    Oracle数据库学习(三)
    查看>>
    Oracle数据库安装成功后,忘记解锁账户和设置密码
    查看>>
    TypeError: create_purple() 接受 0 个位置参数,但给出了 2 个
    查看>>
    Oracle数据库异常--- oracle_10g_登录em后,提示java.lang.Exception_Exception_in_sending_Request__null或Connection
    查看>>
    Oracle数据库异常---OracleDBConsoleorcl无法启动
    查看>>
    oracle数据库异常---SP2-1503: 无法初始化 Oracle 调用界面 SP2-1503: 无法初始化 Oracle 问题的解决办法
    查看>>
    Oracle数据库性能调优
    查看>>
    oracle数据库核心笔记
    查看>>
    oracle数据库笔记---oracleweb视图使用流程,及plsql安装
    查看>>
    oracle数据库笔记---pl/sql的基础使用方法
    查看>>
    Transformer 架构解释
    查看>>