Skip to content

TM1py read-write TM1 data #526

Answered by MariusWirtz
sakulkgupta asked this question in Q&A
Discussion options

You must be logged in to vote

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, s…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by MariusWirtz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants