2015-01-12 93 views
0

試圖找出什麼的默認成員添加到此素文字默認成員 - SSAS

([DateTool].[Aggregation].[Previous Month]) = 
iif( 
([DateTool].[Aggregation].DefaultMember, ParallelPeriod(dim_RPT_period].[Yr-Qtr-Month].[RPT Period Month],1,[dim_RPT_period].[Yr-Qtr-Month].currentmember)) = null,   
NULL, 
([DateTool].[Aggregation].DefaultMember,ParallelPeriod([dim_RPT_period].[Yr-Qtr-Month].[RPT Period Month],1,[dim_RPT_period].[Yr-Qtr-Month].currentmember)) 
);  

這是從實用層面。計算腳本。
我得到了IIF,我得到了ParallelPeriod。 但「(DefaultMember,ParallelPeriod)」有什麼作用?

+0

請添加默認成員的定義,也許這將幫助莫名其妙。但是我把我的猜想放在了W/O之下。 –

回答

0

它看起來像它用來避免無限遞歸。這種技術用於這種動態計算。

比方說,我們運行一些MDX腳本WHERE [DateTool].[Aggregation].[Previous Month]

服務器採用這一計算,從公式(不[DateTool].[Aggregation].DefaultMember),它使用ParallelPeriod像往常一樣,但比它需要[DateTool].[Aggregation].[Previous Month]與其他維度(我們WHERE過濾器)元組的一部分,所以從這個公式一再發生...

所以我們總是需要有一些固定的成員來避免無限遞歸。

這是我的理解,如果它在某處或完全錯誤,請更正。

+0

@Sourav_Agasti,對於焦慮問題感到抱歉:您能否告訴我,如何突出顯示答案的某些部分(就像您爲提高文字的可視化一樣)或給出一些相關主題的鏈接? –

+0

喲得到一切[這裏](http://meta.stackexchange.com/questions/22186/how-do-i-format-my-code-blocks) – SouravA

+0

http://meta.stackexchange.com/questions/22186/how-do-i-format-my-code-blocks – SouravA

0

我的理解是,計算的成員是建立在有價值觀只有當切片機具有[dim_RPT_period].[Yr-Qtr-Month].[RPT Period Month]級別的任何成員。這是我的意見模仿DAX的功能ISCROSSFILTERED功能。

成員建立只有當 切片機具有[dim_RPT_period].[Yr-Qtr-Month].[RPT Period Month]

[DateTool].[Aggregation].DefaultMember一個部件,使得[DateTool].[Aggregation].[Previous Month]將持有價值不如[DateTool].[Aggregation].[ALL] 這是因爲從查詢中留出[DateTool].[Aggregation]層次好

如果切片機沒有從[dim_RPT_period].[Yr-Qtr-Month].[RPT Period Month], 那麼[dim_RPT_period].[Yr-Qtr-Month].currentmember是一樣好[dim_RPT_period].[Yr-Qtr-Month].[ALL] 在這種情況下的前一個成員(這是retu由ParallelPeriod功能)未定義,因此,NULL將被返回。

如果切片機有成員,則會返回non null成員。

要在這進一步說明: (請通過評論讀取)

([DateTool].[Aggregation].[Previous Month]) = 
iif( 
(
[DateTool].[Aggregation].[ALL], 
ParallelPeriod([dim_RPT_period].[Yr-Qtr-Month].[RPT Period Month],1,[dim_RPT_period].[Yr-Qtr-Month].currentmember) 
) //If a member from dim_RPT_period].[Yr-Qtr-Month].[RPT Period Month] level is not in slicer then it would evaluate to NULL 
= null,   
NULL, //In that case the previous month should evaluate to NULL 
//Otherwise, it should give the "previous month" 
([DateTool].[Aggregation].[ALL], 
ParallelPeriod([dim_RPT_period].[Yr-Qtr-Month].[RPT Period Month],1,[dim_RPT_period].[Yr-Qtr-Month].currentmember)) 
);