TM1py read-write TM1 data #526
-
I saw the following in TM1py documentation. My question is can it also read and write data from the TM1 user's sandbox?
Thanks Sakul Gupta |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Yes it can
From: sakulkgupta ***@***.***>
Reply-To: cubewise-code/tm1py ***@***.***>
Date: Thursday, April 15, 2021 at 12:02 PM
To: cubewise-code/tm1py ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [cubewise-code/tm1py] TM1py read-write TM1 data (#526)
I saw the following in TM1py documentation. My question is can it also read and write data from the TM1 user's sandbox?
* Read data from cubes through cube views and MDX Queries
* Write data into cubes
Thanks
Sakul Gupta
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#526>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEK7GZQDHSOSUJDZQCUQCIDTI4ZWZANCNFSM43ACIE2A>.
|
Beta Was this translation helpful? Give feedback.
-
Ryan, Thanks for the quick response. Would you point me to some examples that show how to access it? |
Beta Was this translation helpful? Give feedback.
-
Here are a couple of samples with TM1Service(address="", port=12354, ssl=True, user="admin", password="apple") as tm1:
sandbox = Sandbox(name="My Sandbox")
tm1.sandboxes.create(sandbox) with TM1Service(address="", port=12354, ssl=True, user="admin", password="apple") as tm1:
cube_name = 'c1'
cells = {
("e1", "e1"): 1,
("e2", "e2"): 2
}
tm1.cells.write(cube_name, cells, sandbox_name="My Sandbox") with TM1Service(address="", port=12354, ssl=True, user="admin", password="apple") as tm1:
mdx = """
SELECT
{[d1].[e1], [d1].[e2]} ON ROWS,
{[d2].[e1], [d2].[e2]} ON COLUMNS
FROM [c1]
"""
df = tm1.cells.execute_mdx_dataframe(mdx, sandbox_name="My Sandbox") Essentially all read and write functions take the optional argument |
Beta Was this translation helpful? Give feedback.
Here are a couple of samples