This is a Flask API + TM1py based tool for extracting TM1 cube and dimension data into a star schema format, for use in Power BI / Tableau / etc.
- Extract TM1 cube fact tables
- Extract dimension tables
- Serve data via Flask API or save to csv files
- Install
python (3.x)
- Install requirements:
pip install -r requirements.txt
- Update
config.ini
based onconfig.ini.sample
- Run
TM1 server
defined in config.ini - Run:
python app.py
- when using Flask API to directly extract data (Power BI sample):
get Data
->Web
: input URL (one object each time):
http://<your IP>:<Rest Port>/dimension/<dimension_name>
http://<your IP>:<Rest Port>/cube/<cube_name>
-
Parameter for extract fact data from cube
- skip_consolidation : bool = True # internal hard coded, no choice - skip_zero : bool = True # internal hard coded, no choice) - skip_rule : bool = False # optional, default: False) - measures_pivot : bool = True # True: measures in columns; False: measures in one column plus last column as value) - top : int = None # set a small number in testing
-
Parameter for extract dimension data from hierarchy
- level_type : int =1 # 0: TM1 type, 1: TM1py type
-
Uneven tree of Dimension-Hierarchy
- strongly suggest dimension-hierarchy is even tree (all leaves are in same level).
- if uneven tree(leaves are in different levels), system will fill the blank level with child element in dimension table, as shown in below pic. -
Method: File vs Flask
-Power BI
supports Flask API; if usingFlask
method to extract fact data from cube, it's necessary to setContent-Type
andAccept
as :application/json
inadvanced
setting panel, whilst no need to set for dimension extraction.
-Tableau Desktop
current version doesn't support Flask API (Web connect is depreciated)
- Strongly recommendFile
method, because the performance is much better thanFlask
method. -
cubes/dimensions setting in config.ini
- 'all' for all cubes/dimensions in TM1 system
- No parameter or set parameter equals blank means no cube/dimension is indicated
- Keep the space in cube/dimension name, likeSales Analysis
- cube/dimension name is capital sensitive
- Use ',
' between multiple cubes/dimensions
IBM PA, TM1, star-schema extractor, tm1py, tableau, power BI, data analytics, data engineering, cube extract, dimension table, fact table