TI Function ViewMDXGet Not Working

Post Reply
User avatar
ptownbro
Posts: 31
Joined: Wed Apr 05, 2017 3:03 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2013
Location: Los Angeles, CA

TI Function ViewMDXGet Not Working

Post by ptownbro »

According to the documentation (link at the end), I should be able to use the "ViewMDXGet" TI function to return the MDX associated with a given View.

I've tried to use it as follows, but am getting an error stating the "variable viewmdxget is not recognized":

Code: Select all

MyViewMDX = ViewMDXGet('MyCube', 'MyView');
I've also tried using it on it's on and am getting an error stating there is something missing in the line:

Code: Select all

ViewMDXGet('MyCube', 'MyView');
https://www.ibm.com/support/knowledgece ... dxget.html
Wim Gielis
MVP
Posts: 3105
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: TI Function ViewMDXGet Not Working

Post by Wim Gielis »

What version of TM1 / Planning Anaytics do you have ?
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
User avatar
ptownbro
Posts: 31
Joined: Wed Apr 05, 2017 3:03 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2013
Location: Los Angeles, CA

Re: TI Function ViewMDXGet Not Working

Post by ptownbro »

I'm using Version 10.2.2
tomok
MVP
Posts: 2831
Joined: Tue Feb 16, 2010 2:39 pm
OLAP Product: TM1, Palo
Version: Beginning of time thru 10.2
Excel Version: 2003-2007-2010-2013
Location: Atlanta, GA
Contact:

Re: TI Function ViewMDXGet Not Working

Post by tomok »

The link you pasted is for the the documentation from PA2.0. I've never used that function so I'm pretty sure it's not available in 10.2.2, unless it's in one of the last fix packs.
Tom O'Kelley - Manager Finance Systems
American Tower
http://www.onlinecourtreservations.com/
Wim Gielis
MVP
Posts: 3105
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: TI Function ViewMDXGet Not Working

Post by Wim Gielis »

ptownbro wrote: Wed Apr 18, 2018 8:31 pm I'm using Version 10.2.2
Then this functionality is too new for your environment.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
User avatar
ptownbro
Posts: 31
Joined: Wed Apr 05, 2017 3:03 pm
OLAP Product: TM1
Version: 10.2
Excel Version: 2013
Location: Los Angeles, CA

Re: TI Function ViewMDXGet Not Working

Post by ptownbro »

Ah. Ok. Thanks guys
My24
Posts: 18
Joined: Tue Dec 12, 2017 2:57 pm
OLAP Product: TM1
Version: PA 2.0
Excel Version: Excel 2016

Re: TI Function ViewMDXGet Not Working

Post by My24 »

I'm using PA 2.0 but I also cannot use this function. Is there anyone can use it?
With ASCIIOUTPUT this function retrieves nothing.
I use this syntax : vMDX = ViewMDXGet(vCube,vView)

Regards.
lotsaram
MVP
Posts: 3651
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: TI Function ViewMDXGet Not Working

Post by lotsaram »

Traditional MDX views saved as .vue files (created by user in architect or with TI ViewCreate function) aren't MDX based and wil of course return blank string for MDX value.

This function will only return MDX string for views created in Workspace or other rest API based client like Arc or created with TI function ViewCreateByMDX. These views are stored as .vbx files on the server.

Using the sister function ViewMDXSet you cannot convert a traditional view to MDX view BTW.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
My24
Posts: 18
Joined: Tue Dec 12, 2017 2:57 pm
OLAP Product: TM1
Version: PA 2.0
Excel Version: Excel 2016

Re: TI Function ViewMDXGet Not Working

Post by My24 »

lotsaram wrote: Thu Oct 04, 2018 12:31 pm Traditional MDX views saved as .vue files (created by user in architect or with TI ViewCreate function) aren't MDX based and wil of course return blank string for MDX value.

This function will only return MDX string for views created in Workspace or other rest API based client like Arc or created with TI function ViewCreateByMDX. These views are stored as .vbx files on the server.

Using the sister function ViewMDXSet you cannot convert a traditional view to MDX view BTW.
Thanks a lot for valuable info lotsaram.
I tried these functions and ViewCreatebyMDX function worked.
Hovewer, views created by this function cannot be seen in Architect.
Is there any way to create a view by ViewMDX and these views can be seen in Architect?

Regards.
Wim Gielis
MVP
Posts: 3105
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: TI Function ViewMDXGet Not Working

Post by Wim Gielis »

No. You would have to create a traditional view based on the MDX that you get with ViewMDXGet.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
My24
Posts: 18
Joined: Tue Dec 12, 2017 2:57 pm
OLAP Product: TM1
Version: PA 2.0
Excel Version: Excel 2016

Re: TI Function ViewMDXGet Not Working

Post by My24 »

Wim Gielis wrote: Sun Oct 07, 2018 10:10 am No. You would have to create a traditional view based on the MDX that you get with ViewMDXGet.
Hi Wim,
But when I want to take ASCII of ViewMDX with ViewMDXGet function, the output is blank string.
Please correct but to get a ViewMDX of a traditional view, I know that I must firstly attach a ViewMDX by ViewMDXSet function.

I tried also to use TM1py module to get native view :

SELECT TM1SubsetToSet([Version],"Default") on ROWS, TM1SubsetToSet([Measure],"Default") on COLUMNS FROM [vCube] WHERE ([Dim1].[Dim1SelectedElement],[Dim2].[Dim2SelectedElement],[Dim3SelectedElement].[Dim3SelectedElement])

And use ViewMDXSet to attach the view to traditional view. But it gives this log:
Error: Prolog procedure line (11): View "Default" in cube "vCube" not found
I use this function:ViewMDXSet(vCube, 'Default', vMDX) and vMDX is above MDX.

Note: "Default" is a traditional view that I created before.
lotsaram
MVP
Posts: 3651
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: TI Function ViewMDXGet Not Working

Post by lotsaram »

As I said already you can’t convert a traditional view to a MDX view with ViewMDXSet. The view type is immutable.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
Wim Gielis
MVP
Posts: 3105
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: TI Function ViewMDXGet Not Working

Post by Wim Gielis »

Indeed, you would have to extract the MDX from the PA view, interpret / rework it and create a traditional view based on the result.
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Wim Gielis
MVP
Posts: 3105
Joined: Mon Dec 29, 2008 6:26 pm
OLAP Product: TM1, Jedox
Version: PAL 2.0.9.18
Excel Version: Microsoft 365
Location: Brussels, Belgium
Contact:

Re: TI Function ViewMDXGet Not Working

Post by Wim Gielis »

lotsaram wrote: Thu Oct 04, 2018 12:31 pmThese views are stored as .vbx files on the server.
It's *.xbv ;-)
Best regards,

Wim Gielis

IBM Champion 2024
Excel Most Valuable Professional, 2011-2014
https://www.wimgielis.com ==> 121 TM1 articles and a lot of custom code
Newest blog article: Deleting elements quickly
Post Reply