如何从IBMTM1获取数据

2024-10-02 10:18:24 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经使用针对Python的TM1py包在Python和ibmtm1olap工具之间建立了连接。现在,当我试图从Python中TM1的MDX视图中获取数据时,得到的只是列标题。我阅读了TM1py的文档,看起来get_native_view函数应该只返回视图的一个实例,而不是视图中包含的实际数据。在

from TM1py.Services import TM1Service

with TM1Service(address='hostname', port=12523,user='username', password=****, ssl=False) as tm1:

query = tm1.cubes.views.get_native_view('cube_name', 'View_name', private=True)
print(query)

有人知道从Python的TM1中提取实际数据而不仅仅是列标题的方法吗?在


Tags: 工具数据name文档view视图标题get
1条回答
网友
1楼 · 发布于 2024-10-02 10:18:24

get_native_view函数返回多维数据集视图的定义。在

要使用TM1py将多维数据集从ibmtm1拉到Python中,可以使用get_view_content函数(选项1)或执行MDX查询(选项2)。在

选项1:

from TM1py.Services import TM1Service

with TM1Service(address='localhost', port=12354, user='admin', password='apple', ssl=True) as tm1:
    content = tm1.cubes.cells.get_view_content(cube_name='Plan_BudgetPlan', view_name='Default', private=False)
    print(content)

选项2:

^{pr2}$

相关问题 更多 >

    热门问题