0

我是 MDX 和分析服务的新手,所以请多多包涵。当我运行以下 MDX 查询时,结果值作为 Column AI 的双精度值返回,但是列元数据将数据类型显示为对象类型,而当它应该是双精度值时。我如何强制它识别数据类型为双重,我什至可以这样做吗?我不确定它是如何推断它是对象类型的。

WITH
        MEMBER [Column (A)] AS [Measures].[ColumnA]
        MEMBER [Column (B)] AS [Measures].[ColumnB]
        MEMBER [Column (C)] AS [Measures].[ColumnC]
        MEMBER [Column (D)] AS [Measures].[ColumnD]
        MEMBER [Column (E)] AS [Measures].[ColumnE]
        MEMBER [Column (F)] AS [Measures].[ColumnF]
        MEMBER [Column (G)] AS [Measures].[ColumnB] - [Measures].[ColumnA]
        MEMBER [Column (H)] AS [Measures].[ColumnD] - [Measures].[ColumnC]
        MEMBER [Column (I)] AS [Measures].[ColumnF] - [Measures].[ColumnE]
        SELECT 
        NON EMPTY
        {
            Column (A),
            Column (B),
            Column (C),
            Column (D),
            Column (E),
            Column (F),
            Column (G),
            Column (H),
            Column (I)
        } ON COLUMNS,
        NON EMPTY
        CROSSJOIN(
            CROSSJOIN([T].[TB].[TB],

                  [T].[TT].[TT]),

                  [T].[TR].[TR])  
        ON ROWS
        FROM RePro          
        WHERE 
        (
            [RS].[RS].[EOD],
                [RD].[RD].[DATE],
                [P].[P].[ABCD]
        )
        CELL PROPERTIES VALUE

提前致谢

4

2 回答 2

0

我可能在这里遗漏了一些上下文,但它们[Measures].[ColumnA]本身是否定义为decimal(或money)?

如果是,您能否尝试对您的 MDX 进行这种细微的更改,而不是

WITH MEMBER [Column (A)] ...

将其更改为

WITH MEMBER [Measures].[Column (A)] AS [Measures].[ColumnA] 

这样,当您保持相同的度量上下文时,数据类型定义就会完全传播。

于 2012-11-03T23:30:21.703 回答
0

你可以试试CDbl功能。我在上面找到了一些例子:
Casting nvarchar to Decimal using MDX
Mean, Median and Mode in MDX

于 2012-10-29T18:40:18.867 回答