我试图创建一个SSRS报表数据集作为记录在这里:MDX正常化设置的措施
http://sqlblog.com/blogs/stacia_misner/archive/2010/10/08/29249.aspx
所面临的挑战是,我有多种措施,谁的数据我想在措施包括:列,我想在RowValue列中包含度量的名称。那么,下面的查询的措施“销售金额”仅返回数据:
with
member [Measures].[Measure] as [Measures].[Sales Amount]
member [Measures].[RowValue] as [Product].[Category].CurrentMember.Name
member [Measures].[ColumnValue] as [Date].[Calendar Year].CurrentMember.Name
select {[Measures].[Measure], [Measures].[RowValue], [Measures].[ColumnValue]} on columns,
non empty ([Product].[Category].[Category].Members, [Date].[Calendar Year].[Calendar Year].Members) on rows
from [Adventure Works]
我想要做的就是运行以下类型的查询,但在查询的结构返回上述数据,这将允许我将其插入到SSRS报告矩阵中:
WITH
MEMBER measures.SalesAmount AS [Measures].[Sales Amount]
MEMBER measures.CustomerCount AS [Measures].[Customer Count]
MEMBER measures.InternetFreightCost AS [Measures].[Internet Freight Cost]
SELECT [Date].[Calendar Year].[Calendar Year].Members ON COLUMNS,
{measures.SalesAmount,measures.CustomerCount,measures.InternetFreightCost} ON ROWS
FROM [Adventure Works]
做任何MDX忍者都知道这是否甚至可以用MDX?
对于您引用的文章中描述的查询结构,您需要哪些灵活性?您是否有其他需要提供同一报告的查询,这些报告只有一个度量和行中的任意层次结构,而列中的另一个层次?或者,你所有的报告在列中都有一个层次结构(比如你的样本中的年份)和行中的一个或多个度量值? – FrankPl
你好弗兰克,我只有一个层次(总是日期)。但我确实有多项措施需要包括在内。 –