我能够计算单个层次结构中选定时间维度的属性的 PY 总计,但无法弄清楚如何使其适用于具有单个计算度量的时间维度层次结构。
我不得不使用动态 SET 来填充 Days 并在 SET 上使用 AGGREGATE,如下所示 -
CREATE DYNAMIC SET CURRENTCUBE.[Days]
AS {EXISTING [Time].[Time].[Day]};
CREATE MEMBER CURRENTCUBE.[Measures].[PY Sales Selected]
AS AGGREGATE(
GENERATE(EXISTING [Days],
{PARALLELPERIOD([Time].[Time].[Year],1,[Time].[Time].CurrentMember)}
),
[Measures].[Sales]
),
FORMAT_STRING = "#,#",
VISIBLE = 1
----
CREATE DYNAMIC SET CURRENTCUBE.[Days]
AS {EXISTING [Time].[Current].[Curr Day Flag]};
CREATE MEMBER CURRENTCUBE.[Measures].[PY Sales Selected]
AS AGGREGATE(
GENERATE(EXISTING [Days],
{PARALLELPERIOD([Time].[Current].[Curr Year Flag],1,[Time].[Current].CurrentMember)}
),
[Measures].[Sales]
),
FORMAT_STRING = "#,#",
VISIBLE = 1
两种计算都是单独工作的,但我想将它们结合起来,这样我就可以只有一个计算度量 [Measures].[PY Sales Selected]。
我们有以下时间维度结构 -
我将不胜感激任何帮助!!