Ssas 使用SSA和MDX在列和行上显示不同的尺寸

Ssas 使用SSA和MDX在列和行上显示不同的尺寸,ssas,mdx,Ssas,Mdx,您好,我是SSAS和MDX新手,我需要基于OLAP多维数据集生成ssrs报告。 我不知道如何在列和行上显示不同的维度成员。 维度是列和客户端上的评级和时间,以及行上的状态,如下所示: | a rated | b rated | c rated | Year-3 | Year-2 | Year-1 | Year* | Total| good clients | medium clients| bad clients | total clients | statu

您好,我是SSAS和MDX新手,我需要基于OLAP多维数据集生成ssrs报告。 我不知道如何在列和行上显示不同的维度成员。 维度是列和客户端上的评级和时间,以及行上的状态,如下所示:

              | a rated | b rated  | c rated | Year-3 | Year-2 | Year-1 | Year* | Total|
good clients  |
medium clients|
bad clients   |
total clients |
status 1      |
status 2      |
status 3      |
total status  |
----------------------------------------------------------------------------------------
年份对应于当前年份


如何使用MDX实现这一点?

在MDX中,如果要在同一轴上显示不同维度的成员,可以将它们放入元组中。比如:

select  ([Time].[Calendar].[Year], [Rate].[rating].children) on columns,
select  ( ... , ... ) on rows
from [cube]

可能有助于解决您的问题。

MDX SELECT语句的轴是一组具有相同“维度”的元组。这意味着所有元组必须包含相同维度的成员。因此,您不能让MDX集合按照您的请求由不同维度的成员(成员是元组)组成


尽管如此,我不明白:“收视率和时间栏是独立的”。这到底意味着什么?

一个MDX查询最多可以支持128个指定轴,但很少有MDX查询使用超过5个轴。对于前5个轴,可以使用别名列、行、页、节和章节


尝试使用上面的轴来实现您所期望的,例如查询两个不同的维度。

下面的查询可能适合您。您提到您的多维数据集中没有“所有”成员,因此您需要用相应的默认成员替换查询中的“所有”。我曾尝试在冒险作品中制作类似的塞纳里奥。这些单元格具有Internet销售额

               | topSeller | Bottom Seller  | 2011| 2012 | 
Topcustomers   |
Bottomcustomers|
North America  |
Europe         |

//create 
//SET [Adventure Works].[TopCustomers] AS TopCount(([Customer].[Customer].Members,[Sales Territory].[Sales Territory Country].[All]), 3,[Measures].[Internet Sales Amount])
//SET [Adventure Works].[BottomCustomers] AS bottomCount(([Customer].[Customer].Members,[Sales Territory].[Sales Territory Country].[All]), 3,[Measures].[Internet Sales Amount])
//SET [Adventure Works].[NorthAmerica] AS ([Customer].[Customer].[All],{[Sales Territory].[Sales Territory Country].&[United States],[Sales Territory].[Sales Territory Country].&[Canada]})
//SET [Adventure Works].[Europe] AS ([Customer].[Customer].[All],{[Sales Territory].[Sales Territory Country].&[France],[Sales Territory].[Sales Territory Country].&[Germany],[Sales Territory].[Sales Territory Country].&[United Kingdom]})
//
//SET [Adventure Works].[TopSellers] AS TopCount(([Product].[Model Name].Members,[Date].[Calendar Year].[All]), 3,[Measures].[Internet Sales Amount])
//SET [Adventure Works].[BottomSellers] AS BottomCount(([Product].[Model Name].Members,[Date].[Calendar Year].[All]), 3,[Measures].[Internet Sales Amount])
//SET [Adventure Works].[2011] AS ([Product].[Model Name].[All],[Date].[Calendar Year].&[2011])
//SET [Adventure Works].[2012] AS ([Product].[Model Name].[All],[Date].[Calendar Year].&[2012])
//

select 
{
([Measures].[Internet Sales Amount],[TopSellers]),
([Measures].[Internet Sales Amount],[BottomSellers]),
([Measures].[Internet Sales Amount],[2011]),
([Measures].[Internet Sales Amount],[2012])
}
on columns,

{
([TopCustomers]),
([BottomCustomers]),
([NorthAmerica]),
([Europe])
}
on rows
from [Adventure Works]
结果如下所示

我尝试了这个功能,但它的功能与crossjoin函数完全相同。但我的需求不同,收视率和时间栏是独立的。例如,我不想要2010年被评为a级的好客户,我只想要一列被评为a级的好客户,另一列被评为2010年的好客户数量……这意味着我想在前三列中计算客户的评级,而不考虑时间,然后在最后几列中,我想统计一下本年度加上第1年、第2年等的客户。如何:选择0上的{[Time].[All]*[Rating]。members}+{[Time]。members*[Rating].[All]}。。。假设您在时间维度和评级维度上都有一个“所有”成员。不,因为我在维度中没有“所有”成员,并且因为它会返回关于年份的客户评级,即2010年评级为a的好客户,这不是我想要的……如果您在维度中没有“所有”成员,这意味着它的“默认”成员无论如何都将被使用。这就是我不理解“独立”的原因。@Don Carage我想这就是你想要的。你能核实一下吗