使用聚合函数成员的MDX更改其他度量的值

时间:2015-07-23 11:10:54

标签: sas aggregate mdx olap

使用DEFINE MEMBERs的MDX查询根据SELECT语句中的度量顺序(查询SAS OLAP多维数据集时)给出不同的结果:

WITH
MEMBER [measures].[someAggregateMeasure] as 
'Aggregate(
    { [FinalCustomerDecision].[All Final Customer Decision].[Booked],  
    [FinalCustomerDecision].[All Final Customer Decision].[LSO] 
    }, [Measures].[AcqTenorGrantedAVG])' 
MEMBER [measures].[anotherMeasure] as '[Measures].[XXX]'
SELECT NON EMPTY { 
    [DecisionMonth].[DecisionMonthYM].[All Decision Month (YM)]
} ON COLUMNS, 
NON EMPTY CrossJoin(
CrossJoin({ 
[ProductType].[ProductType].[All Product Type].[CL].Children
}, 
Hierarchize({ 
    LastPeriods(1,[BookingMonth].[All Booking Month (YM)].LastChild.LastChild)       
})), { 
[measures].[someAggregateMeasure],
[measures].[anotherMeasure]
})
ON ROWS
FROM [Cube]

与具有倒置度量顺序的查询相比,给出了'anotherMeasure'的其他值(注意差异仅在最后一行中):

WITH
MEMBER [measures].[someAggregateMeasure] as 
'Aggregate(
    { [FinalCustomerDecision].[All Final Customer Decision].[Booked],  
    [FinalCustomerDecision].[All Final Customer Decision].[LSO] 
    }, [Measures].[AcqTenorGrantedAVG])' 
MEMBER [measures].[anotherMeasure] as '[Measures].[XXX]'
SELECT NON EMPTY { 
    [DecisionMonth].[DecisionMonthYM].[All Decision Month (YM)]
} ON COLUMNS, 
NON EMPTY CrossJoin(
CrossJoin({ 
[ProductType].[ProductType].[All Product Type].[CL].Children
}, 
Hierarchize({ 
    LastPeriods(1,[BookingMonth].[All Booking Month (YM)].LastChild.LastChild)       
})), { 
[measures].[anotherMeasure],
[measures].[someAggregateMeasure]
})
ON ROWS
FROM [Cube]

基本度量XXX是定义成员度量,而不是永久度量。 它是用以下内容构建的:

DEFINE MEMBER [measures].[xxx] as [measures].[a]/[measures].[b];

当我向查询添加a和b时,'anotherMeasure'的值不会随着查询中的度量顺序的改变而改变。

我知道我确实需要在查询中添加a和b以获取度量XXX和anotherMeasure正常工作 问题是AGGREGATE函数MEMBER与其他成员的结果有什么关系?

提前感谢您的帮助。

0 个答案:

没有答案