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
Categories: Business Intelligence, Excel
excel, excel mdx, MDX
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.