您需要在案例中放置 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