我刚刚开始使用OLAP多维数据集。我对MDX查询有一些疑问。我有一个查询:
WITH
MEMBER [Balance].[NegEXPENSE] AS '-[Balance].[Type].[EXPENSE]'
SET BalanceTypeSet AS {[Balance].[Type].[INCOME], [Balance].[NegEXPENSE]}
MEMBER [Balance].[TypeSum] AS AGGREGATE(BalanceTypeSet)
SELECT {Measures.[Sum]} ON COLUMNS,
{[Balance].[Type].[INCOME], [Balance].[Type].[EXPENSE], [Balance].[TypeSum]} ON ROWS
FROM [Balance Cube]
此查询的结果如下:
此结果没有最后一行的名称(TypeSum)。如何为TypeSum添加名称?
感谢。
答案 0 :(得分:0)
您需要添加计算维度成员,试试这个:
WITH
MEMBER [Balance].[Type].[TypeSum] AS AGGREGATE(BalanceTypeSet)
SELECT {[Measures].[Sum]} ON COLUMNS,
{[Balance].[Type]} ON ROWS
FROM [Balance Cube]