简体   繁体   English

基于维属性的SSAS计算成员

[英]SSAS Calculated Member Based on Dimension Attribute

I'm trying to create a calculated measure that returns the converted value of an amount to Euro : i have the measure [Measures].[Montant] in my fact table but i need to use a dimension attribute [Taux Change].[Taux Euro] that represents the conversion rate. 我正在尝试创建一个计算得出的度量,以将金额的转换后的值返回到欧元:我的事实表中具有度量[Measures]。[Montant],但是我需要使用维度属性[Taux Change]。[Taux欧元],表示转化率。

My calculated measure should basically be something like : 我计算出的量度基本上应该是这样的:

[converted_amount] = [Measures].[Montant]*[Taux Change].[Taux Euro] [converted_amount] = [Measures]。[Montant] * [Taux Change]。[Taux Euro]

My problem is that this new calculated measure returns Blank. 我的问题是,此新计算得出的度量返回空白。

Could you please help me find the appropriate MDX code to use in my case. 您能否帮助我找到适合我的情况的MDX代码。

Thanks. 谢谢。

I suspect that, since you say [Taux Change].[Taux Euro] is a dimension attribute rather than a single calculated measure, it's returning a blank value because the member being returned from that dimension is the default member (usually the ALL member). 我怀疑,由于您说[Taux更改]。[Taux欧元]是一个维度属性,而不是一个计算得出的度量,它返回一个空白值,因为从该维度返回的成员是默认成员(通常是ALL成员) 。

Try testing with a single calculated measure: 尝试使用一个计算得出的度量进行测试:

CREATE MEMBER CurrentCube.TauxEuroTest AS 0.91 (or whatever number you like)

then use Measures.TauxEuroTest instead of [Taux Change].[Taux Euro] in your calculated member and see if that works. 然后在您计算出的成员中使用measures.TauxEuroTest而不是[Taux更改]。[Taux欧元],看看是否可行。

As GregGalloway says, it's hard to definitely answer this without more detail: what does [Taux Change].[Taux Euro] actually mean in terms of the dimension structure? 正如GregGalloway所说的那样,没有更多细节就很难肯定地回答这个问题:[Taux Change]。[Taux Euro]在尺寸结构方面实际上意味着什么? Is it pointing to member [Taux Euro] of dimension [Taux Change] 是否指向维度[Taux Change]的成员[Taux Euro]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM