format_string无法正常工作

时间:2016-08-12 04:26:46

标签: ssas mdx olap-cube

WITH MEMBER [Measures].[WagesToSales] as ([Measures].[Value - Fact Wages]/(([Measures].[Value]) - ([Measures].[Sales]))), FORMAT_STRING= '0.00'
SELECT [Measures].[WagesToSales] ON COLUMNS, NON EMPTY { ([Dim Date].[Date Key].[Date Key].ALLMEMBERS * [Dim Store Type].[Store Type].[Store Type].ALLMEMBERS ) } ON ROWS FROM ( SELECT ( Filter( [Dim Location].[Location Name].[Location Name].ALLMEMBERS, Instr( [Dim Location].[Location Name].currentmember.Properties( 'Member_Caption' ), 'BOSTON' )  > 0  ) ) ON COLUMNS FROM ( SELECT ( { [Dim Store Type].[Store Type].&[Boston] } ) ON COLUMNS  FROM [People Dashboard 1]))

结果仍然没有显示两位小数。

enter image description here

有什么我想念的吗?

2 个答案:

答案 0 :(得分:0)

你试试:

更改

FORMAT_STRING= '0.00' 

FORMAT_STRING='##0.00'

答案 1 :(得分:0)

尝试以下方法:

WITH 
MEMBER [Measures].[WagesToSales] as 
  DIVIDE(
    [Measures].[Value - Fact Wages]
   ,[Measures].[Value] - [Measures].[Sales]
  )
 , FORMAT_STRING= "0.00"
SELECT 
  [Measures].[WagesToSales] ON 0
, NON EMPTY 
     [Dim Date].[Date Key].[Date Key].ALLMEMBERS 
   * [Dim Store Type].[Store Type].[Store Type].ALLMEMBERS 
   ON 1
FROM 
  ( 
   SELECT 
       Filter( 
         [Dim Location].[Location Name].[Location Name].ALLMEMBERS
     , Instr( 
         [Dim Location].[Location Name].currentmember.Properties( 'Member_Caption' )
      , 'BOSTON' 
       )  > 0  
       ) 
      ON 0
   FROM 
     ( 
       SELECT 
          [Dim Store Type].[Store Type].&[Boston] ON 0
       FROM [People Dashboard 1]
     )
);