MDX 技术综合应用与实践
1. 条件格式设置
在 MDX 中使用 VBA 语法时,需在函数名前加上 VBA!
。若使用 Excel 函数,则在函数名前加上 Excel!
。以下是条件格式设置的示例代码:
-- conditional formatting
with member [Measures].[Sales in Local Currency] as
case
when [Customer].[Customer Geography].currentmember.name = "France"
then vba!format([Measures].[Internet Sales Amount],"#,###.00€")
when [Customer].[Customer Geography].currentmember.name = "United Kingdom"
then vba!format([Measures].[Internet Sales Amount],"£#,###.00")
when [Customer].[Customer Geography].currentmember.name = "United States"
then vba!format([Measures].[Internet Sales Amount],"$#,###.00")
end
select
[Measures].[Sales in Local Currency]
on columns,
{[Customer].[Customer Geography].[Country].[France