如何在行级维度中使用UniqueName

时间:2016-07-04 07:59:33

标签: ssas mdx

我需要行级维度而不是列级别的UniqueName。

WITH MEMBER [Measures].[CurrMemID] AS [Product].[Product Line].CurrentMember.UniqueName 
SELECT 
      {[Measures].[CurrMemID]} ON COLUMNS,
      {[Product].[Product Line].Members} ON ROWS 
FROM  [Adventure Works]

enter image description here

1 个答案:

答案 0 :(得分:0)

我有一种感觉,你可能要求的是不可能的:只要你交换行和列分析服务就会将单元格扩展到几个列 - 每个产品一个。

如果你的目标是有两个平行的列 - 第一个带有uniqueName而第二个带有标题,那么你可以做这样的事情,然后在客户端只是忽略第一列:

WITH 
MEMBER [Measures].[CurrMemID] AS 
  [Product].[Product Line].CurrentMember.UniqueName 
MEMBER [Measures].[CurrMemCaption] AS 
  [Product].[Product Line].CurrentMember.MEMBER_CAPTION
SELECT 
      {
        [Measures].[CurrMemID],
        [Measures].[CurrMemCaption]
      } ON 0,
      {[Product].[Product Line].Members} ON 1
FROM  [Adventure Works];