Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import olap.xmla.xmla as xmla
- import time
- # Connect to OLAP
- provider = xmla.XMLAProvider()
- connect = provider.connect(location='http://serv-bi.ids-as.local/OLAP/msmdpump.dll',username='test_ssas',password='1234567')
- source = connect.getOLAPSource()
- # OLAP query
- cmd="""
- select
- Non Empty [Client].[Client].[All clients] * {[Measures].[Invoice Count], [Measures].[Invoice Amount]} on 0,
- Non Empty [Date].[Year].[Year].AllMembers on 1
- from [BI Fake]
- """
- # Execute the query
- resource = connect.Execute(cmd,Catalog="TestCube")
- # Get values of cells
- values = resource.getSlice()
- # Get Axis on columns
- columns = resource.getAxisTuple(0)
- # Get Axis on rows
- rows = resource.getAxisTuple(1)
- begin = time.clock()
- item = source.getCatalog("TestCube").getCube("BI fake").getDimensions()[2].getMembers()
- print len(item)
- '''
- for i in range(1,len(item)):
- print item[i-1]
- '''
- #print source.getCatalog("TestCube").getCube("BI fake").getDimensions()[4].getMembers()
- print round(time.clock() - begin, 2), "seconds"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement