我有一个具有日期维度层次结构(年、学期、季度、月、日)的多维数据集。
数据仓库中有 2 个可用的度量。
[AUD DLY] : Daily numbers
[AUD YTD] : Daily incremental YTD numbers
层次结构如下
Date - Dimension
Financial - Hierarchy
Year - [Date].[Financial].[Year]
Semester - [Date].[Financial].[Semester]
Quarter - [Date].[Financial].[Quarter]
Month - [Date].[Financial].[Month]
Day - [Date].[Financial].[Day]
Measures [AUD DLY]
Measures [AUD YTD]
我需要在度量中添加一个 MTD 字段,这样当企业在 Excel 中的切片器上选择特定日期时,例如 2016 年 3 月 3 日,MTD 应按以下任一方式计算:
1) [AUD MTD] should be calculated by subtracting [AUD YTD] on
last day of previous month from the current selected date.
So if we select 3 March 2016 then
[AUD MTD] = [AUD YTD] on 3 March 2016 - [AUD YTD] on 29 Feb 2016
OR
2) [AUD MTD] should be calculated by adding the [AUD DLY] from first day
of the current month until the selected date in that month.
So if we select 3 March 2016 then
[AUD MTD] = SUM ([AUD DLY] from 1 March 2016 to 3 March 2016)
我在 BIDS 2010 的多维数据集设计器的计算选项卡中创建了一个新的计算成员。MDX 查询如下。但是,当我尝试浏览多维数据集时,[AUD MTD] 值仅返回空值。
有人可以帮我做错什么吗?
CREATE MEMBER CURRENTCUBE.[Measures].[AUD MTD]
AS Aggregate
(
PeriodsToDate
(
[Date].[Financial].[Month]
,[Date].[Financial].CurrentMember
)
,[Measures].[AUD DLY]
),
FORMAT_STRING = "Currency",
NON_EMPTY_BEHAVIOR = { [AUD DLY] },
VISIBLE = 1 , DISPLAY_FOLDER = 'AUD Values' , ASSOCIATED_MEASURE_GROUP = 'Measures' ;
此外,企业将使用切片器在 Excel 中使用新的计算度量,他们希望选择任何日期并能够查看该月的 MTD 值。
也有人可以帮助 MDX 查询方法 (1) 和 (2) 吗?
非常感谢您的帮助。