将 MDX 参数传递给 SQL 查询

发布于 2024-10-05 09:13:08 字数 181 浏览 0 评论 0原文

我有几份来自 SSAS 2008 的报告,但其中一份报告必须深入到 SQL Server 报告,因为数据对于多维数据集来说太细化了。

关于传递参数有什么技巧吗?当然,它们是作为 MDX 传入的,我无法找到一种方法来通过源 MDX 获取“密钥”。令人惊讶的是我找不到很多关于此的指示。

让我知道这是否太模糊......

I have several reports that are from SSAS 2008, but one of them has to drill through to a SQL Server report simply because the data is far to granular for a cube.

Any tips on passing parameters? Of course they are passed in as MDX, and I can't figure out a way to get just the "Key" with the source MDX. Surprisingly I can't find a lot of pointers on this.

Let me know if this is too vague...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

胡渣熟男 2024-10-12 09:13:08

您是否将 MDX 作为字符串传入,以便您可以检查和摆弄?如果您可以提取维度和成员名称,您可以在 SQL 数据库中查找名称以找到所需的 ID,然后将其传递?

我假设你得到这样的字符串:
[位置].[所有位置].[南部].[萨里].[吉尔福德]
如果您在 SQL 数据库中查找“Guildford”,您将能够发现它是第 2134 行,这就是您所需要的?

Are you getting the MDX passed in as a string which you can examine and fiddle with? If you can extract the dimension and member name, you could look up the name in the SQL database to find the ID required, which could then be passed on?

I assume you are getting strings like this:
[Location].[All location].[South].[Surrey].[Guildford]
If you look up 'Guildford' in your SQL db you'll be able to find out it is row 2134 and that's what you need?

少女净妖师 2024-10-12 09:13:08

我假设您想从报告操作中调用此报告。如果您的属性具有单个列键,您可以使用以下方式引用它:

[<dimension>].[<hierarchy>].CurrentMember.Properties("MEMBER_KEY")

如果您的属性具有多个键列,您将使用 KEY0、KEY1 等来引用各个部分,而不是 MEMBER_KEY

I'm assuming that you want to call this report from a report action. If your attribute has a single column key you can reference it using something like:

[<dimension>].[<hierarchy>].CurrentMember.Properties("MEMBER_KEY")

If your attribute has multiple key columns you would use KEY0, KEY1, etc to reference the individual parts instead of MEMBER_KEY

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