Advertisements
Home > Business Intelligence, Excel > Display the MDX query of an Excel 2007 PivotTable

Display the MDX query of an Excel 2007 PivotTable

Most of end users navigate into Microsoft SQL Server 2008/2005 Analysis Services Cube with the help of Microsoft Excel 2007. Sometimes they may produce report while browsing Cube data.

Most of them having curiosity about MDX (Multidimensional Expressions) generated by Excel in background. Here is the way to get that MDX out of Excel Sheet.

Sub ShowMDX()
Dim strMDX As String
Dim pvtTable As PivotTable
Dim ws As Worksheet

Set pvtTable = ActiveCell.PivotTable
strMDX = pvtTable.MDX

' Add a new worksheet.
Set ws = Worksheets.Add
ws.Range("A1") = strMDX
End Sub

Besides, Microsoft Excel 2007 offers a very good MDX quality of the produced query against Analysis Services 2008/2005

Sandip Shinde

Advertisements
  1. November 27, 2013 at 5:59 pm

    Good post. I learn something new and challenging on sites I stumbleupon everyday.
    It will always be interesting to read content from other writers and practice something from their sites.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: