MDX问题:列中的源数据可以包含方括号([]),如何阻止这些被解释为分隔符?
我正在开发一个使用 OLAP 多维数据集的项目,我们在 MDX 语句方面遇到问题。
问题是我们的源数据中有方括号。例如: 客户 [客户代码]
这是针对名称为“CustomerA [123]”的特定客户的示例查询。度量值列表并不重要,已被忽略:
SELECT <measures> ON COLUMNS,
[Customer_Dim].[All Customer_Dim].[CustomerA [123]] ON ROWS
FROM [cubename]
因此,当我们为某个特定客户提交此查询时,MDX 使用这些方括号作为分隔符。
这会导致错误,因为它正在读取 [123] 并认为存在语法错误。
我们希望防止方括号中的数据被读取为分隔符。有没有办法屏蔽它们,或者我们被迫将角色更改为其他角色?
谢谢
I am working on a project that is using OLAP cubes, and we have a problem with an MDX statement.
The problem is that our source data has square brackets in. For example:
Customer [customer code]
This is an example query on a specific customer, whose name is "CustomerA [123]". The measures list is insignificant and has been left out:
SELECT <measures> ON COLUMNS,
[Customer_Dim].[All Customer_Dim].[CustomerA [123]] ON ROWS
FROM [cubename]
So when we submit this query for one specific customer, the MDX uses those square brackets as delimiters.
This causes an error, because it is reading the [123] and thinks there is a syntax error.
We want to protect the square brackets from the data from being read as delimiters. Is there a way to shield them, or are we forced to change the character to something else?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 MDX 中,您可以使用带方括号的名称,但必须使用转义字符 ] :
You can have names with brackets in MDX, you'll have to use the escape character ] :