【发布时间】: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