title: Find data type of measures in Cube using MDX queries
body: <p>I am working SSAS MDX queries. Now I need to identify the data type of each columns from the MDX queries. I have already tried as below. </p>
  
  <pre><code>WITH MEMBER PageSize AS 1  Member [Measures].[My Type] as TypeName([Measures].[Budget Delivered COGS])
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/6CXHR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6CXHR.png" alt="enter image description here"></a></p>
  
  <p>But it returns double for the currency field. First of all does Cubes have the data type as currency, percentage?</p>
  
  <p>If not, is there is any way to find out whether the column is currency or percentage or double or integer?</p>
  
  <p>I have seen this post <a href="https://stackoverflow.com/questions/9951314/retrieving-data-type-of-measures-from-an-mdx-query-cellset-in-c-sharp">Find the data type</a>. But that is not feasible with the currency and percentage. </p>
  
  <p>Here I am pasting my entire query.</p>
  
  <pre><code> WITH MEMBER PageSize AS
    1
  MEMBER [Measures].[My Type] AS
    TypeName ( [Measures].[Budget Delivered COGS] )
  MEMBER [PageNumber] AS
    1
  MEMBER [Measures].[Orderby Measure] AS
    [Measures].[Budget Delivered COGS]
  MEMBER [Orderby] AS
    "BASC"
  SET ROWAXISWOF AS
    NonEmpty (
      ( [Time Periods].[Fiscal Year].[Fiscal Year].Members, [Time Periods].[Fiscal Quarter].[Fiscal Quarter].Members, [Time Periods].[Fiscal Month].[Fiscal Month].Members, [Time Periods].[Fiscal Week].[Fiscal Week].Members ),
      {
        { [Measures].[Budget Delivered COGS] },
        { [Measures].[Break Even Delivered] }
      }
    )
  SET ROWAXISWF AS
    Filter ( ROWAXISWOF, [Measures].[Budget Delivered COGS] )
  SET ROWAXIS AS
    IIf ( 'Filter' = "NotFilter", ROWAXISWF, ROWAXISWOF )
  MEMBER [Measures].[MaxRowCount] AS
    ROWAXIS .Count
  SET ROWAXIS_Count AS
    IIf (
      'Paging' = "Paging",
      (
      CASE
      WHEN [Orderby] = 'BASC'
      THEN Tail (
        TopCount ( ROWAXIS, PageSize * PageNumber, [Measures].[Orderby Measure] ),
        PageSize
      )
      ELSE Tail (
        BottomCount ( ROWAXIS, PageSize * PageNumber, [Measures].[Orderby Measure] ),
        PageSize
      ) END ),
      ROWAXISWOF
    )
  SELECT ( IIf (
    'Paging' = "Paging",
    (
    { [Measures].[Budget Delivered COGS], [Measures].[Break Even Delivered], [Measures].[MaxRowCount], [Measures].[My Type] } ),
    { [Measures].[Budget Delivered COGS], [Measures].[Break Even Delivered], [Measures].[My Type] }
  ) ) ON COLUMNS,
  ROWAXIS_Count ON ROWS
  FROM (
    SELECT (
    { [Time Periods].[Fiscal Year].&amp;[2011], [Time Periods].[Fiscal Year].&amp;[2012], [Time Periods].[Fiscal Year].&amp;[2013], [Time Periods].[Fiscal Year].&amp;[2014], [Time Periods].[Fiscal Year].&amp;[2015] } ) ON COLUMNS
    FROM [Homestore Sales]
  )
  </code></pre>
  
  <p>If we get the data in the query, I will loop through the column and find out in C#. Any help is much appreciated. Thanks in advance.</p>