简单 MDX 计算成员

发布于 2025-01-17 07:11:38 字数 542 浏览 2 评论 0原文

在我的简单多维数据集中,我有一个度量 = \[Measure\].\[Salary\],我还有 \[DimEmployee\].\[EmployeeLastName\].\[Smith \]. 我想创建计算的度量,我可以在轴 0 中显示两个度量 - \[Measure\].\[Salary\] 和计算的度量\[Measure\].\[SmithsSalaries\],比较 Smith 的收入与总工资之间的差异。

我想将 Measure.SmithSalaries 与所有维度的其他度量进行比较。是否可以使用 SCOPE 语句创建这样的度量?

我正在玩 SCOPE 语句,但只有选择 DimEmployee 时它才会显示结果。我正在寻找以块的形式运行的东西以避免性能问题。

In my simple cube, I have a measure = \[Measure\].\[Salary\], I have also \[DimEmpployee\].\[EmployeeLastName\].\[Smith\]. I would like to create calculated measure, where I can display in Axis 0 two measures - \[Measure\].\[Salary\] and calculated measure \[Measure\].\[SmithsSalaries\], to compare difference between Smith's earnings vs Total Salary.

I would like to compare Measure.SmithSalaries with other measures accross all diemensions. Is it possible to create such a measure using SCOPE statement?

I was playing around SCOPE statements, but it was displaying results only if DimEmployee was selected. I am looking for something which is running in blocks to avoid performance issues.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱殇璃 2025-01-24 07:11:38

我认为你只需要一个简单的计算测量。

CREATE MEMBER CURRENTCUBE.[Measures].[SmithSalaries]
 AS ([DimEmployee].[EmployeeLastName].[Smith], [Measures].[Salary]), 
VISIBLE = 1  ; 

之后,您可以将其与您的总工资相结合以获得比率。

CREATE MEMBER CURRENTCUBE.[Measures].[SmithSalaries Ratio]
 AS DIVIDE(([DimEmployee].[EmployeeLastName].[Smith], [Measures].[Salary]),[Measures].[Salary]) 
VISIBLE = 1  ; 

SCOPE 允许您在不同的 Dimension 组合发挥作用时具有不同的行为,例如在选择 DimEmployee 时返回不同的计算,但在其他情况下仅返回正常的计算。就像一个非常有效的 IF 条件来检查此计算的轴中的内容。

I think you only need a simple calculated measure.

CREATE MEMBER CURRENTCUBE.[Measures].[SmithSalaries]
 AS ([DimEmployee].[EmployeeLastName].[Smith], [Measures].[Salary]), 
VISIBLE = 1  ; 

After that you can combine that with you total salary for example to get a ratio.

CREATE MEMBER CURRENTCUBE.[Measures].[SmithSalaries Ratio]
 AS DIVIDE(([DimEmployee].[EmployeeLastName].[Smith], [Measures].[Salary]),[Measures].[Salary]) 
VISIBLE = 1  ; 

SCOPE allows you to have different behaviors when different combinations of Dimensions are into play, like returning a different calculation when the DimEmployee is selected but otherwise just return the normal calculation. Like a Very efficient IF condition to check what are in the Axis of this calculation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文