将尺寸值更改为度量

时间:2016-03-05 15:37:57

标签: mdx mdxstudio

我想将维度值用作计算度量

case when [time].[month].current member is 
        [time].[month].&[januaray] then 'januaray'

        when [time].[month].&[feb] then 'feburary'
else 'None' end

我希望将这12个月的值显示为度量

1 个答案:

答案 0 :(得分:0)

您应该可以使用属性MemberValueMember_ValueMemberCaption

以下是:

[time].[month].currentMember.membervalue

[time].[month].currentMember.member_value

[time].[month].currentMember.member_Caption

您应该 需要在mdx中执行此操作:

case when [time].[month].current member is 
        [time].[month].&[januaray] then 'januaray'

        when [time].[month].&[feb] then 'feburary'
else 'None' end

这相当于:[time].[month].currentMember.member_Caption。如果case的原因是将feb扩展为feburary,那么您的语句看起来没问题 - 我会使用NULL而不是字符串None而且您还需要摆脱CurrentMember的差距:

CASE 
   WHEN ([time].[month].currentmember IS [time].[month].&[januaray]) THEN 'januaray'
   WHEN ([time].[month].currentmember IS [time].[month].&[feb]) THEN 'feburary'    
        when [time].[month].&[feb] then 'feburary'
ELSE NULL END