0
下面的脚本给出了我想要的结果。任意挑选一个维度以将成员添加到
这感觉就像一个黑客,因为我已将自定义成员VALUE
和VALUE_MTD
添加到层次结构[Customer].[Country]
。我已经任意选择了这个层次 - 只是没有使用[Measures]
或[Date].[Calendar]
,因为它们已经在使用了。
是否有一个更标准的方法来返回完全相同的一组单元?
WITH
MEMBER [Customer].[Country].[VALUE] AS
Aggregate([Customer].[Country].[(All)].MEMBERS)
MEMBER [Customer].[Country].[VALUE_MTD] AS
Aggregate
(
PeriodsToDate
(
[Date].[Calendar].[Month]
,[Date].[Calendar].CurrentMember
)
,[Customer].[Country].[VALUE]
)
SELECT
{
[Customer].[Country].[VALUE]
,[Customer].[Country].[VALUE_MTD]
} ON 0
,NON EMPTY
{
[Measures].[Internet Sales Amount]
,[Measures].[Internet Order Quantity]
}
*
Descendants
(
{
[Date].[Calendar].[Month].&[2007]&[12]
:
[Date].[Calendar].[Month].&[2008]&[01]
}
,[Date].[Calendar].[Date]
) ON 1
FROM [Adventure Works];
好的 - 我想我们有一些时间计算,所以我可以使用它:明天再试。 – whytheq 2014-11-14 20:32:01