簡體   English   中英

如何將度量值聚合限制為已計算成員中的單個維度

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

我有以下查詢,其中計算得出的度量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]

當我還將“資產”維度放置在行軸中時,[Measures]。[Fund_NAV]會根據單個基金中存在的資產進一步拆分數字。 我想要的是[措施]。[Fund_NAV]除資金外不應拆分。 如果fund1有3個資產,則應顯示相同的[Measures]。[Fund_NAV]應對應於fund1和資產的3個不同行。 當前情況是完全合乎邏輯的,因為事實表與基金和資產維度都相關。 我不想刪除事實表和資產之間的關系。 有什么方法可以將[Measures]。[Fund_NAV]計算出的度量值的聚合限制為僅針對基金維度?

如果我理解正確,則需要稍微調整計算所得成員的定義。

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

顯式添加[All]成員將覆蓋[Fact PNL Data].[Asset]層次結構中對當前成員的隱式引用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM