使用数据透视表时如何显示 Excel 2007 生成的 MDX?

发布于 2024-09-01 17:33:38 字数 60 浏览 2 评论 0原文

和标题说的差不多。在 Excel 2007 中使用数据透视表时是否可以显示发送到 OLAP 源的 MDX?

Pretty much what the title says. Is it possible to show the MDX that is sent to OLAP source when using a pivot table in Excel 2007?

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

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

发布评论

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

评论(5

梦在深巷 2024-09-08 17:33:38

您可以从 codeplex 站点 (http://olappivottableextend.codeplex.com/) 下载 OLAP 数据透视表扩展

安装它。

然后您可以右键单击并查看 OLAP 查询。

问候,
安巴里什

You can download the OLAP Pivot Table Extensions from the codeplex site( http://olappivottableextend.codeplex.com/)

Install it.

You can then right click and see the OLAP query.

Regards,
Ambarish

傲世九天 2024-09-08 17:33:38

我也很想看到 Excel 中的数据透视表生成的 MDX。除了手动输入 MDX 之外,在用户在数据透视表本身上进行选择和过滤等操作后,我看不到查看 MDX 的方法。

但我在这里找到了一个快速的 vba 片段
PivotTable.MDX

我所做的只是 ALT + F11 打开 VBA 窗口

插入用户表单,如下所示

在此处输入图像描述

单击用户表单内的文本框,然后在属性窗口中更改这两个设置

  • Multiline - True
  • Wordwrap - True

Paste 在下面的代码中

Sub CheckMDX()
     
Dim pvtTable As PivotTable
 
Set pvtTable = ActiveSheet.PivotTables(1)
 
UserForm.TextBox.Value = pvtTable.MDX
UserForm.Show

End Sub

确保您的数据透视表是活动工作表(即在单元格中单击的数据透视表上打开工作表)。

按运行按钮,应该会弹出一个用户窗体,您可以在其中复制 MDX 文本。

输入图片此处描述

这是在 Excel 365 上进行的。希望这会有所帮助。

I was curious to see the MDX generated by a pivot table in Excel also. Apart from imputing MDX manually I couldn't see a way to see the MDX after a user has selected and filtered etc.. on the pivot table itself.

But I found a quick vba snippet here
PivotTable.MDX

All I did was ALT + F11 to bring up the VBA window

Insert a userform like so

enter image description here

Click inside the textbox inside the userform and change these two settings in the properties window

  • Multiline - True
  • Wordwrap - True

Paste in the code below

Sub CheckMDX()
     
Dim pvtTable As PivotTable
 
Set pvtTable = ActiveSheet.PivotTables(1)
 
UserForm.TextBox.Value = pvtTable.MDX
UserForm.Show

End Sub

Make sure your Pivot Table is the active sheet (i.e have the worksheet open on the pivot table clicked in a cell).

Press the run button and a userform should pop up like so where you can copy out the MDX text.

enter image description here

This was on Excel 365. Hope this helps.

荒人说梦 2024-09-08 17:33:38

如果您有探查器,您可以设置 Analysis Services 跟踪并在途中捕获它,或者您是否需要在不执行它的情况下查看它?

If you have profiler you could set up an Analysis Services trace and catch it on the way, or do you need to see it without executing it?

給妳壹絲溫柔 2024-09-08 17:33:38

虽然 OLAP 数据透视表扩展仍然可用于 Excel 2013,但您无法再右键单击表并查看 MDX。这是微软不遗余力地让最终用户和开发人员的生活变得更加困难的又一个例子。 Excel 中应内置查看当前数据透视表选择的 MDX 的功能。这并不是因为微软的开发人员太粗心而没有优先考虑如此重要的事情,也不是因为微软的开发人员看到了附加产品的潜力。无论如何,这就是为什么他们经常被讨厌的一个例子。多年来,我什至无法计算我在正常工作日之外失去的所有时间,因为 Microsoft 经理、开发人员的无能或恶意行为......但是还有什么其他工具集可以完成 Excel 和 SSAS 的功能呢?更换它并不是一件容易的事,所以我们必须处理他们损坏的工具。

While the OLAP Pivot Table Extensions are still available for Excel 2013, you can no longer right-click on the table and view the MDX. This is yet another example of MIcrosoft going out of their way to make life more difficult for end-users and developers. The ability to view MDX for the current PivotTable selections should be built into Excel. It's not because Microsoft's developers either were too careless to give such a critical thing priority or because the powers that be saw a potential for an add-on product. Regardless, it's an example of why they are often hated. Over the years I can't even count all the hours of life I've lost outside the normal workday because the incompetent or malevolent behavior of Microsoft's manager, developers... But what other toolset can do what Excel and SSAS do? It's not an easy thing to replace so we have to deal with their crippled tools.

懵少女 2024-09-08 17:33:38

有一个免费的基于 Web 的数据透视表工具,名为 WebPivotTable,它可以直接连接到 SSAS 多维数据集并显示当前数据透视表的每个 MDX 语句选择。它具有 Excel 的所有功能,但具有更直观的用户界面。在 MDX 窗口中,您甚至可以测试自己的 MDX 语句并获得以表格和图表显示的结果。

这是 演示文档

There is a free web based pivot table tool called WebPivotTable which can connect to SSAS cube directly and display each MDX statement for teh current PivotTable selections. It has all functions as Excel but with more intuitive user interface. In MDX windows, you can even test your own MDX statement and get results displayed in table and charts.

Here is Demo and Documents.

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