在MDX查询中转义特殊字符 [英] Escaping special characters in an MDX Query
问题描述
我正在为客户构建BI仪表板.我们的数据存储在分析服务器多维数据集中.总体来说一切正常,但是smartalec测试人员决定创建一个名为`〜!@#$%^& *()_ +-= [] {} |;':<>?,./名称可以很好地显示为查询结果的一部分,但是如果用户尝试深入商人,我们当然会炸掉b/c,\ {; [都是MDX的一部分.有办法逃脱这些字符吗?我试过在前面加上\或将字符加倍.我已经搜索了全部,但没有打开任何东西.
I'm building a BI dashboard for my client. Our data is stored in an analysis server cube. Overall things work great, but a smartalec tester decided to create a merchant with the name `~!@#$%^&*()_+-=[]{}|;':"<>?,./ The name shows up just fine as a part of a query result, but if the user trys to drill in to the merchant we of course blow up b/c the \ { ; [ " are all part of MDX. Is there a way to escape these characters? I've tried putting a \ in front, or doubling the character. I've searched all over, but not turn up anything.
TIA
推荐答案
您的名称必须使用[]表示法,并且必须(仅)使用右括号.这是一个示例,其声明要转义的度量,其名称要转义(请注意]]):
You must use the [] notation for your names and escape (only) the right bracket. Here is an example declaring a calculated measure with the name to escape (notice the ]] ):
with member [`~!@#$%^&*()_+-=[]]{}|;':"<>?,./] as 42
select [`~!@#$%^&*()_+-=[]]{}|;':"<>?,./] on 0 from [cube]
这篇关于在MDX查询中转义特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!