Tm1py: Version Transfer using TM1py

Created on 17 Nov 2020  路  2Comments  路  Source: cubewise-code/tm1py

I am trying to work on generic version transfer script using TM1py. The script is working fine with small size cube, but with large cube data it fail's.

Below are the step I did in python script

1) Took Tm1 instance name, source version, target version as argument from user
2) Get all cube names from tm1 instance and check if it contains the version dimension.
3) If yes, create native view for source and target(views are not zero suppressed).
4) Loop through all dimension in the cube and assign version dim on column and all other dimension on rows in source and target view.
5) Convert the source and target view to mdx query using "as_MDX" functionality
6) Get the cell set and values from source mdx query and assign the same to target mdx query.

The issue occurs in cube with large dataset, as the source view is not zero suppressed, I get Memory issue.
As an alternative solution, I created a zero suppressed source view, but causes inconsistency in data in target view.
I also tried to just create zero suppressed source view and replace the version element with target version, but getting unhashable error.

**Version

  • TM1py: 1.5.0
  • TM1 Server Version: 11.0.4
question

Most helpful comment

The issue occurs in cube with large dataset, as the source view is not zero suppressed, I get Memory issue.

You will run out of RAM here.. its the same for everyone. You have to split the requests and execute them in parallel.
I believe the below example could help you:
https://github.com/cubewise-code/tm1py/issues/304#issuecomment-668392471

As an alternative solution, I created a zero suppressed source view, but causes inconsistency in data in target view.

If you zero-out the target version before loading the data, this should not be an issue.

I also tried to just create zero suppressed source view and replace the version element with target version, but getting unhashable error.

This is definitely an issue with the code you have written.

All 2 comments

The issue occurs in cube with large dataset, as the source view is not zero suppressed, I get Memory issue.

You will run out of RAM here.. its the same for everyone. You have to split the requests and execute them in parallel.
I believe the below example could help you:
https://github.com/cubewise-code/tm1py/issues/304#issuecomment-668392471

As an alternative solution, I created a zero suppressed source view, but causes inconsistency in data in target view.

If you zero-out the target version before loading the data, this should not be an issue.

I also tried to just create zero suppressed source view and replace the version element with target version, but getting unhashable error.

This is definitely an issue with the code you have written.

You could try pagination as well, I guess...

cubeName = "plan_BudgetPlan"
viewName = "Budget Input Detailed"

#connect to tm1
with TM1Service(**creds) as tm1:

    cellset_id = tm1.cells.create_cellset_from_view(cube_name=cubeName, view_name=viewName, private=False)
    cells1 = tm1.cells.extract_cellset(cellset_id=cellset_id, top=1, skip=0, skip_contexts=True, delete_cellset=False)
    cells2 = tm1.cells.extract_cellset(cellset_id=cellset_id, top=1, skip=10, skip_contexts=True, delete_cellset=False)
    cells3 = tm1.cells.extract_cellset(cellset_id=cellset_id, top=1, skip=20, skip_contexts=True, delete_cellset=False)
Was this page helpful?
0 / 5 - 0 ratings

Related issues

scrambldchannel picture scrambldchannel  路  6Comments

SachinAnalytics picture SachinAnalytics  路  3Comments

scrumthing picture scrumthing  路  4Comments

hermie64 picture hermie64  路  3Comments

pourushgupta picture pourushgupta  路  3Comments