Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services SSRS老化报告MDX查询_Reporting Services_Mdx - Fatal编程技术网

Reporting services SSRS老化报告MDX查询

Reporting services SSRS老化报告MDX查询,reporting-services,mdx,Reporting Services,Mdx,我想生成老化报告 列表项 下面是我的MDX查询。但它给出了每个时期的累计金额。我想要这样的结果 0-30 Days 30-60 Days 60-90 Days > 90 Days Customer 1 15 8 11 120 Customer 2 32 21 7 75 --------------

我想生成老化报告

  • 列表项
下面是我的MDX查询。但它给出了每个时期的累计金额。我想要这样的结果

          0-30 Days     30-60 Days    60-90 Days     > 90 Days

Customer 1   15          8             11              120
Customer 2   32         21             7                75

-------------------------------------------------------------------

With
Member [Measures].[0-30] as
Sum(
ClosingPeriod([Cal Date].[Month].[Month], [Cal Date].[Month].[All]).Lag(1)
: ClosingPeriod([Cal Date].[Month].[Month], [Cal Date].[Month].[All].Lag(0))
,[Measures].[Master Count] )

Member [Measures].[31-60] as
ClosingPeriod([Cal Date].[Month].[Month], [Cal Date].[Month].[All]).Lag(2)
: ClosingPeriod([Cal Date].[Month].[Month], [Cal Date].[Month].[All].Lag(1))
,[Measures].[Master Count] )

Member [Measures].[61-90] as
Sum(
ClosingPeriod([Cal Date].[Month].[Month], [Cal Date].[Month].[All]).Lag(3)
: ClosingPeriod([Cal Date].[Month].[Month], [Cal Date].[Month].[All].Lag(2))
,[Measures].[Master Count] )

select
{[Measures].[0-30], [Measures].[31-60], [Measures].[61-90] } on 0,
{
[Customer].[Name].[Name].Allmembers
} on 1
from [My Cube]

我觉得你的剧本不错。尝试将
closingperiod
部分切换到自定义设置:

With
set [x] as
  {ClosingPeriod([Cal Date].[Month].[Month], [Cal Date].[Month].[All])}
Member [Measures].[0-30] as
  Sum(
   [x].item(0).Lag(1) : [x].item(0).Lag(0)
   ,[Measures].[Master Count] 
  )
Member [Measures].[31-60] as
  Sum(
   [x].item(0).Lag(2) : [x].item(0).Lag(1)
   ,[Measures].[Master Count] 
  )
Member [Measures].[61-90] as
  Sum(
   [x].item(0).Lag(3) : [x].item(0).Lag(2)
   ,[Measures].[Master Count] 
  )
Member [Measures].[90-120] as
  Sum(
   [x].item(0).Lag(4) : [x].item(0).Lag(3)
   ,[Measures].[Master Count] 
  )
Member [Measures].[>120] as
  Sum(
   null : [x].item(0).Lag(4)
   ,[Measures].[Master Count] 
  )
select
 {[Measures].[0-30], [Measures].[31-60], [Measures].[61-90], [Measures].[90-120], [Measures].[>120]} on 0,
 {
 [Customer].[Name].[Name].Allmembers
 } on 1
from [My Cube]

除此之外,如何为“>120”天的记录添加列。请在冒号的一侧使用“null”。我会修改答案。以上是更新后的代码。检查“>120”列。我想像那样使用SET Cnt