SSAS Correlation MDX Function
时间:2010-12-30 来源:经典神话
Correlation (set, y numeric value expression [, x numeric value expression])
Standard (not in Essbase 9)
This function calculates a correlation coefficient between x-y pairs of values.
The y numeric expression is evaluated over the set to get the y values
for each pair. If the x numeric expression is present, then it is evaluated
over the set. Otherwise, the cells formed by the set are evaluated within
the current context, and their values are used as the x values. The formula
for the correlation coefficient is as follows:
If either the y or the x numeric expression is a logical or text value, or if the
value is NULL, then that tuple and its related values are not included in
the correlation. Zero values for y and x are included.
话不多说: 上代码示例
Correlation(
{
(
[Subject].[Subject Name].currentmember,
[Student].[Sutdent Name].[All].children
)
},
(
[Measures].[Score],
[Subject].[Subject Name].[All]
),
(
[Measures].[Score],
[Subject].[Subject Name].currentmember
)
)
这个是求学生单科成绩与学生总分的相关系数.
效果图:
与Excel 计算公式所得结果相同.
本人也是该领域新手.~ 边学边总结. 苦于资料有用的真的很少,郁闷~ ....