所有维度的相同公式,即在AGGREGATION之前计算 [英] same formula for all dimentions, that is calculated before AGGREGATION

查看:128
本文介绍了所有维度的相同公式,即在AGGREGATION之前计算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




如果有人可以帮助我,我会非常感激。
我有一个多维数据集(让我们称之为A,B,C,D)。对于其中一个计算的度量(让它为X),我需要对所有维度的所有属性使用非标准总计,这将使用相同的非标准总计度量X

因为这个度量有一个公式,指的是其他计算的度量,它们使用求和和乘法,并且应该在聚合之前计算(简单来说就是X = CM1 -CM2)

我创建了一个特殊的虚拟临时度量在数据源视图中(让我们称之为M1)并使用NULL初始化它,以便在SCOPE赋值中使用它。为了强制给定维度的所有属性使用SCOPE赋值我使用
的键属性维度,Berlow是MDX的例子,它适用于维度A的所有属性。

我首先将公式分配给vurtual度量M1,然后使用M1的值来获得非标准总计



SCOPE([Measures]。[X],[A]。[A]。[All]);

SCOPE([Measures]。[M1],[A]。[A]。[AKey] .MEMBERS);

THIS = [Measures] .CM1 - [措施] .CM2;

END SCOPE;

THIS = [措施]。[M1];

END SCOPE;



I需要对其他维度B,C,D做同样的事情(即应用相同的公式[Measures] .CM1 - [Measures] .CM2)

但是当我尝试复制粘贴范围时以上其他3维(即只需用A替换A,然后用C代替A,然后用D)b
我没有得到我期望的结果,因为在那种情况下,以后的范围会超出第1范围分配的价值

即使我使用不同的虚拟措施(即不仅仅是M1,而是M2,M3,M4)

我没有"感觉"范围如何在这个特定的情况下工作;案例

提前谢谢你
Pavel

解决方案

嗨  Pavel,


如果你想改变  [A]。[A]。[AKey] .MEMBERS的meausre, 我想你可以使用下面的查询 

 SCOPE([Measures]。[M1],[A]。[A]。[AKey] .MEMBERS); 
THIS = [Measures] .CM1 - [Measures] .CM2;
END SCOPE;

你说这不起作用,如果可能的话,你可以告诉我更详细的信息和你期望的输出吗?然后我会更正确地帮助你。


最好的问候,

Zoe Zhi



I’d be very much obliged if anyone could help me with this
I have a cube with for dimentions (lets call them A,B,C,D). For one of the calculated measure(let it be X) I need to use non-standard total for all attributes of all for dimentions, that would use the same non-standard totaling of the measure X
Because this measure has a formula that refer to other calculated measures, that use both summing and multiplication and should be calculated before aggregating (lets for simplicity be X = CM1 -CM2)
I created a special virtual temporary measure in the data source view (let’s call it M1) and initialized it with NULL so that to use it in SCOPE assignment. To force all attributes of a given dimention to use the SCOPE assignment I use the key attribute of the dimention, Berlow is the example of MDX that work well for all attributes of dimention A.
I first assign the formula to vurtual measure M1, and after use the value of M1 for getting non-standard totalling

SCOPE([Measures].[X],[A].[A].[All]);
SCOPE([Measures].[M1],[A].[A].[AKey].MEMBERS);
THIS = [Measures].CM1 – [Measures].CM2;
END SCOPE;
THIS = [Measures].[M1];
END SCOPE;

I need to do the same for others dimentions B,C,D (i.e. apply the same formula [Measures].CM1 – [Measures].CM2)
But when I try just to copy-paste the scope above for other 3 dimentions (i.e. just replace A with B, then C, then D)
I do not get the result I expect, because in that case somehow later scopes overiide the value of the 1st scope assignment
even if i use different virtual measures (i.e. not just M1, but M2, M3, M4)
I do not "feel" how the scope works in this particul;ar case
Thank you in advance
Pavel

解决方案

Hi  Pavel,

If you want to change [A].[A].[AKey].MEMBERS's meausre,  I think you could just use below query 

SCOPE([Measures].[M1],[A].[A].[AKey].MEMBERS);
THIS = [Measures].CM1 – [Measures].CM2;
END SCOPE;

And you said this don't work, if possible, could you please inform me more detailed information and your expect output? Then I will help you more correctly.

Best Regards,
Zoe Zhi


这篇关于所有维度的相同公式,即在AGGREGATION之前计算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆