【发布时间】:2012-04-18 15:16:55
【问题描述】:
我们在时间维度中有一个层次结构,我们尝试使用维度的层次结构获取一些数据,但我们不想将层次结构放在 where 子句中。 这是代码:
with
member Measures.last_month as
sum(
ParallelPeriod(
[TIME].[Periods].[Level 06],1
),
[Ims Units])
select
{[Ims Units],last_month} on columns,
[TIME].[Periods].[Level 06].members on rows
from [Analyzer cube]
它返回所有月份,具体来说:
2011 年 2 月:[ims units] 为 47271,last_month 为 51103
2011 年 3 月:[ims units] 为 55293,last_month 为 47271
但是如果我添加了 were 子句并删除了 select 子句中的层次结构:
with
member Measures.last_month as
sum(
ParallelPeriod(
[TIME].[Periods].[Level 06],1
),
[Ims Units])
select
{[Ims Units],last_month} on columns
from [Analyzer cube]
where [TIME].[MONTH NAME].&[201103 March]
它显示:
2011 年 3 月:[ims 单位] 为 55293,last_month 为空
我们在 last_month 有空值,因为它已被过滤时间维度。 有没有办法在不将层次结构放在 select 子句和 where 子句上并且仍然使用 parallelperiod 函数的情况下获得上个月? (ParallelPeriod的使用只是一个例子)
谢谢, 弗朗西斯科
【问题讨论】: