Reporting services SSAS/MDX-总和和组结果-日期比较 我正在从TFS2010 Cube上开发MDX数据集,我也在Team Foundation Server——报告和仓库论坛上发表。
我正在寻找过去几个月内老化缺陷的趋势。我有代码生成我需要的数据,因为我无法以SSRS线图所需的方式进行计数。代码如下:Reporting services SSAS/MDX-总和和组结果-日期比较 我正在从TFS2010 Cube上开发MDX数据集,我也在Team Foundation Server——报告和仓库论坛上发表。,reporting-services,ssas,mdx,Reporting Services,Ssas,Mdx,我正在寻找过去几个月内老化缺陷的趋势。我有代码生成我需要的数据,因为我无法以SSRS线图所需的方式进行计数。代码如下: WITH MEMBER [Measures].[AgedGroupTotal] AS ([Measures].[Work Item Count]) MEMBER [Measures].[AgedGroup30] AS IIF(DATEDIFF("d", [Work Item].[System_CreatedDate].CurrentMember.Name, [Date].[Da
WITH MEMBER [Measures].[AgedGroupTotal] AS ([Measures].[Work Item Count])
MEMBER [Measures].[AgedGroup30] AS IIF(DATEDIFF("d", [Work Item].[System_CreatedDate].CurrentMember.Name, [Date].[Date].CurrentMember.Name) <= 30, [Measures].[Work Item Count], null)
MEMBER [Measures].[AgedGroup3060] AS IIF(DATEDIFF("d", [Work Item].[System_CreatedDate].CurrentMember.Name, [Date].[Date].CurrentMember.Name) > 30 AND DATEDIFF("d", [Work Item].[System_CreatedDate].CurrentMember.Name, [Date].[Date].CurrentMember.Name) <= 60, [Measures].[Work Item Count], null)
MEMBER [Measures].[AgedGroup6090] AS IIF(DATEDIFF("d", [Work Item].[System_CreatedDate].CurrentMember.Name, [Date].[Date].CurrentMember.Name) > 60 AND DATEDIFF("d", [Work Item].[System_CreatedDate].CurrentMember.Name, [Date].[Date].CurrentMember.Name) <= 90, [Measures].[Work Item Count], null)
MEMBER [Measures].[AgedGroup90] AS IIF(DATEDIFF("d", [Work Item].[System_CreatedDate].CurrentMember.Name, [Date].[Date].CurrentMember.Name) > 90, [Measures].[Work Item Count], null)
SELECT NON EMPTY { [Measures].[AgedGroup30], [Measures].[AgedGroup90], [Measures].[AgedGroup6090], [Measures].[AgedGroup3060], [Measures].[AgedGroupTotal] }
ON COLUMNS, NON EMPTY { ([Date].[Month].[Month].ALLMEMBERS *
[Date].[Week].[Week].ALLMEMBERS *
[Date].[Date].[Date].ALLMEMBERS *
[Work Item].[System_CreatedDate].[System_CreatedDate].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME
ON ROWS FROM ( SELECT ( [Date].[Date].&[2013-01-01T00:00:00] : [Date].[Date].&[2013-03-31T00:00:00] )
ON COLUMNS FROM ( SELECT ( { [Work Item].[System_State].&[Active] } )
ON COLUMNS FROM ( SELECT ( { [Work Item].[System_WorkItemType].&[Bug] } )
ON COLUMNS FROM [Work Item])))
WHERE ([Work Item].[System_WorkItemType].&[Bug], [Work Item].[System_State].&[Active])
结果如下:
图片:
月周日期创建日期AgedGroup30 AgedGroup90 AgedGroup6090 AgedGroup3060 AgedGroupTotal
2013年1月1日至2013年1月5日的一周2012年3月15日空2空2
截至2013年1月5日的一周2013年1月1日2012年3月21日空3空3空3
2013年1月1日至2013年1月5日的一周2012年3月29日空1空1空1
2013年1月1日至2013年1月5日的一周2012年3月30日空0空0
2013年1月1日至2013年1月5日的一周2012年4月3日空1空1空1
2013年1月1日至2013年1月5日的一周2012年4月5日空5空5
2013年1月1日至2013年1月5日的一周2012年4月6日无效10无效10
2013年1月1日至2013年1月5日的一周2012年4月12日空0空0
2013年1月1日至2013年1月5日的一周2012年4月14日空2空2
问题是[Work Item].[System\u CreatedDate].[System\u CreatedDate]。需要包含在结果中的所有成员。如果不包括此成员,则年龄组的DATEDIFF公式不会计算并给出错误。如果我将此数据输出到一个SSRS表中,并在AgedGroups上求和,然后排除创建的日期,我将获得所需的数据集:
图片:
月周日期年龄组30年龄组3060年龄组6090年龄组90年龄组总计
2013年2月至2013年2月02日的一周20 1 2 25
2/2/2013 20 1 2 2 25
截至2013年2月9日2月3日20 1 2 25的一周
2/4/2013 28 0 3 2 33
2/5/2013 37 0 3 2 42
2/6/2013 50 1 3 1 55
2/7/2013 60 1 7 3 71
2/8/2013 58 2 7 3 70
2013年2月9日58 2 7 3 70
问题是,我需要在我的MDX数据集中汇总这个结果。但是,我不能排除产生问题的创建日期。我是MDX新手,但在SQL中,使用临时表和sum/group by可以简化此操作。但是,我知道MDX不能以这种方式工作。有人能帮我弄清楚如何在MDX中获取这个数据集吗
谢谢你的帮助
埃夫加普