简体   繁体   English

如何将度量值聚合限制为已计算成员中的单个维度

[英]How measure aggregation can be restricted to single dimension in calculated member

I have the following query where calculated measure TotalPNLPercent shows the % pnl of indivisual fund. 我有以下查询,其中计算得出的度量TotalPNLPercent显示了个性化基金的百分比pnl。

With 
Member [Measures].[Fund_NAV] as
([Measures].[NAV_Calculated_IncludingAccruals_CurrentDay],[Fact PNL Data].[Fund].CurrentMember)

Member [Measures].[TotalPNLPercent]
as (
 Case 
    when isempty([Measures].[Fund_NAV]) or [Measures].[Fund_NAV] = 0
    then 0
    else
    ([Measures].[Total MTM PNL] / [Measures].[Fund_NAV])*100
 End
)
select
non empty
{
    [Measures].[TotalPNLPercent],
    [Measures].[Total MTM PNL],
    [Measures].[Fund_NAV]
} on 0,
non empty
{
    [Fact PNL Data].[Fund].[Fund].Members *
//  [Fact PNL Data].[Asset].[Asset].Members*
    [Fact PNL Data].[Rundate].&[2015-02-11T00:00:00]
} on 1
from 
[DSV_NirvanaClientDW]

When i also put the Asset dimension in the rows axis, [Measures].[Fund_NAV] further splits the number based on the Assets present within a single fund. 当我还将“资产”维度放置在行轴中时,[Measures]。[Fund_NAV]会根据单个基金中存在的资产进一步拆分数字。 What i want is [Measures].[Fund_NAV] should not split up other than the funds. 我想要的是[措施]。[Fund_NAV]除资金外不应拆分。 If fund1 have 3 assets then same [Measures].[Fund_NAV] should appear corresponding to fund1 and 3 different rows of the assets. 如果fund1有3个资产,则应显示相同的[Measures]。[Fund_NAV]应对应于fund1和资产的3个不同行。 Current behavior is fully logical as Fact table is related to the both the fund and asset dimension. 当前情况是完全合乎逻辑的,因为事实表与基金和资产维度都相关。 I don't want to remove the relationship between the Fact table and asset. 我不想删除事实表和资产之间的关系。 Is there any way by which we can restrict the aggregation of the [Measures].[Fund_NAV] calculated measure to the Fund dimension only?? 有什么方法可以将[Measures]。[Fund_NAV]计算出的度量值的聚合限制为仅针对基金维度?

If I understand correctly, you would need to tweak you calcualted member's definition a bit. 如果我理解正确,则需要稍微调整计算所得成员的定义。

With 
Member [Measures].[Fund_NAV] as
(
  [Measures].[NAV_Calculated_IncludingAccruals_CurrentDay],
  [Fact PNL Data].[Fund].CurrentMember,
  [Fact PNL Data].[Asset].[All]
)

Adding the [All] member explicitly would overwrite the implicit reference to the current member from [Fact PNL Data].[Asset] hierarchy. 显式添加[All]成员将覆盖[Fact PNL Data].[Asset]层次结构中对当前成员的隐式引用。

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

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