Closed user1493 closed 4 years ago
Hi @user1493 ,
here is a sample:
import configparser
from TM1py import TM1Service, MDXView
config = configparser.ConfigParser()
config.read(r'config.ini')
mdx = """
SELECT
{[}Clients].Members} ON ROWS,
{[}Groups].Members} ON COLUMNS
FROM [}ClientGroups]
"""
mdx_view = MDXView(cube_name="}ClientGroups", view_name="my_new_view", MDX=mdx)
with TM1Service(**config['tm1srv01']) as tm1:
tm1.cubes.views.create(view=mdx_view, private=False)
Note that you can't see MDX views in architect and perspectives
Hi Marius,
Yes that makes sense, thank you very much for the sample!
Looking for a function that would create a cube view based on the MDX expression. This is like the ViewCreateByMDX functionality we have in PA.