-1

一度にメジャーとディメンションのデータをフィルター処理したい

case 
when [measure].[frequency] >3 and [poa].[segment].&A then 'red'
when [measure].[frequency] <3 and [poa].[segment].&A then 'yellow'
when [measure].[frequency] =3 and [poa].[segment].&A then 'Green'
else 'NA' end

これらのスクリプトは、計算されたメンバーで作成しました..しかし、正常に実行されていません.親切に助けてください

4

1 に答える 1

0

ケースにcurrentMemberの比較を入れる必要がありますか?

私はこれがうまくいくと思いますか?

case 
when [measure].[frequency] >3 then 'red'
when [measure].[frequency] <3 then 'yellow'
when [measure].[frequency] =3 then 'Green'
else 'NA' 
end

「NA」を使用する必要がありますか?nullこの状況で使えませんか?

case 
when [measure].[frequency] >3 then 'red'
when [measure].[frequency] <3 then 'yellow'
when [measure].[frequency] =3 then 'Green'
else NULL 
end

calc の他のセクションは、次のような演算子[poa].[segment].&Aを使用して何かと比較する必要があるようです。IS

([poa].CURRENTMEMBER IS [poa].[segment].&A)

caseしたがって、これをステートメントに追加します。

CASE
WHEN [measure].[frequency] >3 
        AND ([poa].CURRENTMEMBER IS [poa].[segment].&A) THEN 'red'
WHEN [measure].[frequency] <3 
        AND ([poa].CURRENTMEMBER IS [poa].[segment].&A) THEN 'yellow'
WHEN [measure].[frequency] =3 
        AND ([poa].CURRENTMEMBER IS [poa].[segment].&A) THEN 'Green'
ELSE NULL 
END
于 2016-03-06T09:22:42.337 に答える