Gui_99
Gui_99

Reputation: 51

Tm1 to python to R

I would like to create a dashboard using R. However, all the data that I need to connect is from TM1.

The easiest way that I found is using an python library called TM1py to connect to tm1 data.

I would like to know what is the easist to access to access TM1py library from R ?

Thanks

Upvotes: 1

Views: 491

Answers (3)

Ravi Naidu
Ravi Naidu

Reputation: 128

There is a tm1r package that can be used to access TM1 data by writing REST-APIs to TM1

https://github.com/muhammedalionder/tm1r/blob/master/README.md

The CRAN project link below

https://cran.r-project.org/web/packages/tm1r/index.html data can be imported from 'TM1' via MDX view or native view

An example REST-API call on TM1 to get elements in Dimension http://localhost:14321/api/v1/Dimensions('Version')/Hierarchies('Version')/Members

Upvotes: 1

Gui_99
Gui_99

Reputation: 51

The only way that I could connect was using tm1py script:

SCRIPT

Then connect to R via PythonInR library using this command:

pyConnect("C:/Users/.../python.exe")
pyExecfile("FILE.py")
data <- pyGet("Data")

As Fabian Gehring mentioned, using Httr can be a great way to do this directly, but I still didn't find the best way.

Upvotes: 0

Fabian Gehring
Fabian Gehring

Reputation: 1173

It seems as if you only want to read data from tm1. Therefore a "simple" mdx query should be fine. Have a look at the package "httr" how to send POST-Requests. Then it's pretty staright forward to port the relevant parts from tm1py to R.

Upvotes: 1

Related Questions