0

特定の条件で新しいメジャーを計算しようとしています。最初に第 1 レベルのメンバーを作成し、それを次のメンバー定義で使用しようとしました。

次のメンバー「CashDisp」は If 条件でゼロと評価されています。私は SSAS を初めて使用します。これを修正するのを手伝ってください

/*
The CALCULATE command controls the aggregation of leaf cells in the cube.
If the CALCULATE command is deleted or modified, the data within the cube is affected.
You should edit this command only if you manually specify how the cube is aggregated.
*/
CALCULATE;    
CREATE MEMBER CURRENTCUBE.[Measures].CashDispensed
 AS [Measures].[Orig Trans Amount]/100, 
VISIBLE = 1;     
CREATE MEMBER CURRENTCUBE.[Measures].CashDisp
 AS IIF([Dim Trans Type Code].[Trans Type Code] ='10'
and [Dim Termn Ln].[Termn Ln]= 'PRO1'
and [Dim Reversal Reason].[Reversal Reason] ='00'
and [Dim Trans Response Code].[Trans Response Code] ='051',[Measures].CashDispensed,0), 
VISIBLE = 1  ; 
4

1 に答える 1

1

問題は、ディメンション値を比較する方法です。

あなたが言う時

[Dim Trans Type Code].[Trans Type Code] ='10'

それは本当に比較しています

[Dim Trans Type Code].[Trans Type Code].[All] を「10」に。

次のように比較を記述する必要があります。

IIF([Dim Trans Type Code].[Trans Type Code].currentmember IS [Dim Trans Type Code].[Trans Type Code].&[10],[Measures].CashDispensed,0)

その例は要約されていますが、各次元の変化を見ることができます。これには、各ディメンション階層がクエリのどこかにあることも必要です。そうでない場合、それはそのすべてのバージョンであり、IIF は作成したメンバーに評価されません。

于 2013-10-15T15:16:47.627 に答える