Skip to content

Instantly share code, notes, and snippets.

@bkanuka
Created May 1, 2014 18:24
Show Gist options
  • Save bkanuka/11458189 to your computer and use it in GitHub Desktop.
Save bkanuka/11458189 to your computer and use it in GitHub Desktop.
import olap.xmla.xmla as xmla
provider = xmla.XMLAProvider()
con = provider.connect(location='http://{server}/OLAP/msmdpump.dll'.format(server='YOUR SERVER IP'))
# Verify that we are connected
print c.getMDSchemaCubes()
# Write MDX query
cmd = """SELECT NON EMPTY { [Measures].[Count] } ON COLUMNS FROM [OLAP]"""
cur = con.Execute(cmd)
# get all data:
cur.getSlice()
# get Values only:
cur.getSlice(properties="Value")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment