Tm1py: CellSet content method not supported

Created on 10 Sep 2019  Â·  6Comments  Â·  Source: cubewise-code/tm1py

Hey Marius,
We have been playing with the extract_cellset_csv method and noticed some odd behaviors. It auto zero suppresses and automatically enables the first Alias for each element.

I touched base with IBM/Hubert on this and he said that method is not officially supported and was only in place for the Watson analytics connector (now defunct). I think we could replace it with another call and possibly use compact Json. Wanted to get your thoughts.
Thanks

question

All 6 comments

Hi @rclapp,

yes the extract_cellset_csv and the execute_mdx_dataframe make use of this undocumented function.
It does behave a bit special, but at this moment it is the fastest way to retrieve data through the TM1 REST API and it is reliable. We actually use it in production heavily at a client here in Zürich for over a year now.

I agree. It would be great if TM1py offered a more "official" way to retrieve TM1 data fast.
I opened an issue to implement faster methods for retrieving cellvalues and elements with compact json here #162.

Unfortunately I'm a bit occupied with other topics at the moment, so in the next weeks I would probaly only spend time on TM1py if there are open bugs. Feel free to start a branch for the implementation.

Sorry to come back to such an old topic. but I am trying to extract data from tm1 to a csv file. I was using execute_view_csv, which afaik utilizes said extract_cellset_csv method and my result is quite the opposite regarding the alias. It seems the activated alias for the rows is not used and I get the principal name. Is there an easy way to extract data from a native view with the proper alias?

Hi @scrumthing,

I can think of two possible solutions to your problem

  1. Use the execute_view_raw method and specify elem_properties=Name,Attributes/Alias. Then you get all the data you need but you have to deal with the raw JSON response of the REST API

  2. After you retrieved the data from the cube view, you execute an MDX query against the }ElementAttributes_ cube and ask explicitly for the Alias values of the elements you retrieved from the view.

Thanks @MariusWirtz! I did it in a similar fashion as (1). But I think I only went with the „normale“ view function and did the cvs manually. If you are interested I will look for my solution tomorrow.

I am getting old. I did it exactly as you described it in (2). :-D _Great minds always think alike_.
Thanks for your feedback. :-)

@MariusWirtz

Believe this one can be closed based on #279

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hermie64 picture hermie64  Â·  3Comments

scrumthing picture scrumthing  Â·  4Comments

macmaj picture macmaj  Â·  4Comments

cubewise-gng picture cubewise-gng  Â·  5Comments

hermie64 picture hermie64  Â·  3Comments