更改 MDX 查询的维度属性的标题

Change titles for the dimension properties of MDX Query

我想重命名我从 MDX 查询中查询的列,但在 DIMENSION PROPERTIES 中,我尝试了不同的方法(WITH MEMBER / WITH SET ...),但它们只适用于 rows/columns 但不在 DIMENSION PROPERTIES 子句中。我希望能从社区得到一些帮助。

我的查询内容如下:

WITH
MEMBER [Measures].[Closing Balance (HL)] AS [Measures].[1234123]
SELECT
 {
[Measures].[Closing Balance (HL)]
}
 ON AXIS(0) ,
 NON EMPTY
{
[0SALES_OFF].[All].Members.Children
}
DIMENSION PROPERTIES
[0SALES_OFF].[2ZWSALER__0SALES_OFF],
[0SALES_OFF].[1ZWSALER__0SALES_OFF],
 ON AXIS(1)
FROM
 [TABLE_NAME]
SAP VARIABLES [ZVMONYR] INCLUDING "01.2019":"04.2019"

如果我查询此结果 table 如下所示:

| [0SALES_OFF].[2ZWSALER__0SALES_OFF] | [0SALES_OFF].[1ZWSALER__0SALES_OFF] | [Measures].[Closing Balance (HL)] |
|-------------------------------------|-------------------------------------|-----------------------------------|
| 111                                 | ONE NAME                            | 123.09                            |
| 222                                 | ANOTHER NAME                        | 233.23                            |

但我想要的是这样重命名列:

| SALES_OFFICE_ID | SALES_OFFICE_NAME | [Measures].[Closing Balance (HL)] |
|-----------------|-------------------|-----------------------------------|
| 111             | ONE NAME          | 123.09                            |
| 222             | ANOTHER NAME      | 233.23                            |

在此先感谢您的帮助!

我想你可以使用这种方法? https://docs.microsoft.com/en-us/analysis-services/multidimensional-models/mdx/mdx-member-properties-user-defined-member-properties?view=asallproducts-allversions

因此创建两个利用 CURRENTMEMBER 的新措施:

WITH 
  MEMBER [Measures].[Closing Balance (HL)] AS 
    [Measures].[1234123] 
  MEMBER [Measures].[SALES_OFFICE_ID] AS 
    [0SALES_OFF].[0SALES_OFF].CurrentMember.Properties("2ZWSALER__0SALES_OFF") 
  MEMBER [Measures].[SALES_OFFICE_NAME] AS 
    [0SALES_OFF].[0SALES_OFF].CurrentMember.Properties("1ZWSALER__0SALES_OFF") 
SELECT 
  {
    [Measures].[Closing Balance (HL)]
   ,[Measures].[SALES_OFFICE_ID]
   ,[Measures].[SALES_OFFICE_NAME]
  } ON AXIS(0)
 ,NON EMPTY 
    {[0SALES_OFF].[All].MEMBERS.Children} ON AXIS(1)
FROM 
[TABLE_NAME]
SAP VARIABLES [ZVMONYR] INCLUDING "01.2019":"04.2019"