如何在mdx查询中重新格式化度量

时间:2019-07-18 13:50:12

标签: sql ssas mdx-query

我在SSAS实例上运行MDX查询。在栏中显示为货币的金额,其中包含空格和,。例如R 1 200,10。

我不想更改数据仓库上的任何内容,但想要更改MDX查询中的格式,以便结果在列中显示为1200.10(一个纯数字)

我在现有的MDX查询顶部添加了以下代码,它们给出了错误的格式。

with
member [Measures].[Gross Amt Exc Base]  as [Measures].[AMT] , FORMAT_STRING="###0.00"

这是我创建的代码:

with
member [Measures].[Gross Amt Exc Base]  as [Measures].[AMT] , FORMAT_STRING="###0.00"

SELECT NON EMPTY { [Measures].[Gross Amt Exc Base]  } ON COLUMNS, 
NON EMPTY {(StrToMember('[Tran Date].[Actual Date].&[' + Format(Now()-1,'yyyy-MM-dd') + 'T00:00:00]')
           :StrToMember('[Tran Date].[Actual Date].&[' + Format(Now()-3,'yyyy-MM-dd') + 'T00:00:00]') *
             [Dim Store].[Store Number].[Store Number].ALLMEMBERS *
             [Dim SKU].[SKU Code].[SKU Code].ALLMEMBERS *
             [Dim SKU].[Product Code].[Product Code].ALLMEMBERS ) } DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS 
FROM [Dolfin Dwh FTS] CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

我想查看1200.10,但收到以下错误消息

"Executing the query ...
The 'Gross Amt Exc Base' calculated member cannot be created because a member with the same name already exists.
Run complete"

请有人帮帮我。

0 个答案:

没有答案