【问题标题】:MDX script - mix dimensions with parameterMDX 脚本 - 将尺寸与参数混合
【发布时间】:2016-12-09 08:46:16
【问题描述】:

早安
我正在研究一个具有两个日期维度、结构相同的多维数据集。 预订日期是一个日期,我每天加载大约 1000 条记录。
Fix Admin Allowed Date 是另一个在日常记录中不同的日期。

样本可以在这里找到:

|booking__|fix______|sheet_measure|
|------------------------------------------------- ---|
|20161207,|20161104,|100
|20161207,|20161109,|150
|20161207,|20161209,|250
|20161208,|20160801,|80,
|20161208,|20161110,|150,
|20161208,|20161208,|250,
|20161209,|20161008,|2,
|20161209,|20161210,|1,
|20161209,|20161211,|20,

我只想查询该数据集,其中管理员允许的修复日期小于或等于预订日期。 (在示例中:仅显示:20161207 => 20161104、20161208 => 20160801、20161110、20161208 和 20161209 => 20161008)

我正在使用这个 mdx 查询:

SELECT  NON EMPTY { [Measures].[Sheet Missing] } ON COLUMNS,{[Booking Date].[Date].[Date].ALLMEMBERS} * {LastPeriods(2,StrToMember("[Booking Date].[Calendar Week].&[2016 KW 49]" ) )  } } ON ROWS FROM [ProductionCube] where ([Date - Fix Admin Allowed Date].[Calendar].[Date].&[20140101] : STRTOMEMBER('[Date - Fix Admin Allowed Date].[Calendar].[Date].&['+Format(Now(),'yyyyMMdd')+']') )

我尝试使用 currentmember.properties("Key") 如下:

   STRTOMEMBER('[Date - Fix Admin Allowed Date].[Calendar].[Date].&['+ [Booking Date].[Date].currentmember.properties("Key") +']') )

它包含平行周期,因为我会在报告中看到最后 2 周。

你怎么看?真的有这么复杂吗?
我的想法不多了..

感谢阅读

【问题讨论】:

    标签: ssas mdx olap dimensions


    【解决方案1】:

    我只是想知道您是否可以使用 datediff 创建计算成员以生成数字输出,然后对其进行过滤?

    with
    member [Measures].[Fix Admin is less than Booking Date] as
    datediff("d", <booking date member expression>, <fix date member expression>)
    <body of select statement... include filter statement against [Measures].[Fix Admin is less than Booking Date]>
    

    抱歉,我无法提供完整的解决方案......不过,如果这有帮助,请告诉我。

    【讨论】:

      猜你喜欢
      • 2010-09-19
      • 1970-01-01
      • 1970-01-01
      • 2012-11-18
      • 2013-04-21
      • 2019-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多