Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retrieve MDX query from Excel 2

Status
Not open for further replies.

pabloj

Technical User
Jul 4, 2002
183
IT
Hi, is there any way to retrieve the MDX statement generated by Excel while you are browsing a cube?
Thanks in advance for any help!

Stick to your guns
 
Not that I know of, but it shouldn't be to hard to figure out what the query looks like based upon the datagrid layout in Excel.

"Shoot Me! Shoot Me NOW!!!"
- Daffy Duck
 
It is not so hard, but it's extremely slow .... it's all about productivity you know.

Stick to your guns
 
For those interested in a more useful answer I have found out that the PivotTable object has an MDX property that shows the actual query.

Stick to your guns
 
Hi pabloj,

Could you tell me exactly where to look in Excel to find the above Pivot table object and it's MDX properties ? I am some what new to using this in Excel. Thanks.
 
In a macro you have to pass reference to the current cell (like on right click on the cell), then

....
Set pcell = ActiveCell.PivotCell
Set pt = pcell.PivotTable
qry = pcell.PivotTable.MDX
'this contains the MDX query
MsgBox qry

Stick to your guns
 
pabloj,

Digging in code usually is where an answer lives. For your efforts enjoy a star.

"Shoot Me! Shoot Me NOW!!!"
- Daffy Duck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top