MDX问题:列中的源数据可以包含方括号([]),如何阻止这些被解释为分隔符?

发布于 2024-12-02 04:21:51 字数 437 浏览 5 评论 0原文

我正在开发一个使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风筝在阴天搁浅。 2024-12-09 04:21:52

在 MDX 中,您可以使用带方括号的名称,但必须使用转义字符 ] :

[Customer_Dim].[All Customer_Dim].[CustomerA [123]]] // note 3 ]]]

]] -> character ']', last for a 'classical' mdx bracket

You can have names with brackets in MDX, you'll have to use the escape character ] :

[Customer_Dim].[All Customer_Dim].[CustomerA [123]]] // note 3 ]]]

]] -> character ']', last for a 'classical' mdx bracket
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文