SSAS立方体计算 - 将日期维度成员与常量进行比较(来自过滤器选择) [英] SSAS cube calculation - comparing date dimension members with constant (from filter selection)

查看:87
本文介绍了SSAS立方体计算 - 将日期维度成员与常量进行比较(来自过滤器选择)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个日期维度"报告日期"和多维数据集中的另一个日期维度"Dep Date"。第一个与销售指标无关,另一个与销售指标无关。两者都具有层次Y-Q-M-D。


在数据透视表上衡量"销售额"由Dep Date月份提供。过滤器Dep日期(用户选择Q1 2019)和报告日期(用户选择2019-02-10,即2月10日)被选中。


报告日期.YQMD:2019-02-10


Dep Date.YQMD:2019-Q1


年月   销售         销售选定日期


2019年1月        115652        115652


2019年2月        106386        36725


2019年3月        140548       


我需要获得一个计算的度量"销售选定日期"这是直到"报告日期"之前的销售额。日期(由用户在过滤器中选择)。用户始终只选择"报告日期"过滤器中的一个值。例如,如果用户在2019年2月选择报告日期= 10th
,那么在行"2019年1月"上选择。销售选择日期必须等于销售额,在"2019年2月"中销售选定日期必须等于总和(销售)直到2月10日,在行"2019年3月"上。销售选定日期必须为空。
通常我需要从报告日期中选择一个值并使用它来过滤Dep Date。


任何人都可以解释如何创建这个计算的度量"销售选定日期"吗? / p>

Thnx!


解决方案

Kiivik,


您可以考虑创建另一个输入维度来计算过滤器销售额。


有关详细实施,请参阅:


保留历史记录 - MDX用于"从日期"和"到日期"


最好的问候,




I have one date dimension "Report Date" and another date dimension "Dep Date" in the cube. First one is not connected to the sales measure and the other one is. Both have hierarchy Y-Q-M-D.

On pivot table measure "Sales" is presented by Dep Date months. Filters Dep Date (user selects Q1 2019) and Report Date (user selects 2019-02-10, ie Feb 10th) are selected.

Report Date.Y-Q-M-D: 2019-02-10

Dep Date.Y-Q-M-D: 2019-Q1

Year Month    Sales          Sales Selected Date

Jan 2019       115652       115652

Feb 2019       106386       36725

Mar 2019       140548       

I need to get a calculated measure "Sales Selected Date" which is Sales amount until "Report Date" date (selected by user in filter). User always selects only one value in Report Date filter. For example if user selects Report Date=10th February 2019 then on the row "Jan 2019" Sales Selected Date must equal Sales, on the fow "Feb 2019" Sales Selected Date must equal sum(Sales) only until the 10th of Feb, on the row "Mar 2019" Sales Selected Date must be empty. Generally I need to take selected value from Report Date and use it to filter Dep Date.

Could anyone explain how to create this calculated measure "Sales Selected Date"?

Thnx!

解决方案

Hi, Kiivik,

You could consider creating another input dimension to calculate filter sales.

For detailed implementation, please refer:

Holding History – MDX For "From Date" and "To Date"

Best Regards,

Will


这篇关于SSAS立方体计算 - 将日期维度成员与常量进行比较(来自过滤器选择)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆