MTD使用MDX进行一个月的每一天

时间:2013-11-05 13:27:57

标签: ssas mdx

您好目前我有一个要求,即用户想要查看一个月中每天的MTD值。例如最近30天的MTD号码。我有这个查询工作1天

with
set [today2] as strtoset('[Date].[Call Day].&['+ format(now()-15,'yyyy-MM-ddT00:00:00')+ ']')

member [measures].[MTD_Deno] as sum(
periodstodate([Date].[Month],[today2].item(0)),[Measures].[NCH])

member [Measures].[MTD_Num] as sum(
periodstodate([Date].[Month],[today2].item(0)),[Measures].[CSSC OUT])

select  { [measures].[MTD_Deno],[Measures].[MTD_Num],[Measures].[NCH],
 [CSSC OUT], [FSC OUT], [HSI OUT],
 [EVRC OUT], [Transfers],  [Conference],  [TOS_OUT],
 [TPV_OUT],  [CREDIT VER OUT], [Pay By Phone OUT] 

}
on columns, 
 non empty([Location Name].[Location Name],[Area].&[Mid Atlantic] as Area,
 strtomember('[Date].[Call Day].&['+ format(now()-13,'yyyy-MM-ddT00:00:00')+ ']')

 )
  on rows
from [Outbound_Summary] 
where ( 
{[Center Function].&[Online],[Center Function].&[Redirect]}, 
{[Center Type].&[CSSC]}
);

但是我希望看到过去30天的数据,有没有办法实现这一目标。

0 个答案:

没有答案