Page 1 of 1

TI Function ViewMDXGet Not Working

Posted: Wed Apr 18, 2018 7:10 pm
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

Re: TI Function ViewMDXGet Not Working

Posted: Wed Apr 18, 2018 7:32 pm
by Wim Gielis
What version of TM1 / Planning Anaytics do you have ?

Re: TI Function ViewMDXGet Not Working

Posted: Wed Apr 18, 2018 8:31 pm
by ptownbro
I'm using Version 10.2.2

Re: TI Function ViewMDXGet Not Working

Posted: Wed Apr 18, 2018 8:37 pm
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.

Re: TI Function ViewMDXGet Not Working

Posted: Thu Apr 19, 2018 8:40 am
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.

Re: TI Function ViewMDXGet Not Working

Posted: Fri Apr 20, 2018 3:05 pm
by ptownbro
Ah. Ok. Thanks guys

Re: TI Function ViewMDXGet Not Working

Posted: Thu Oct 04, 2018 10:53 am
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.

Re: TI Function ViewMDXGet Not Working

Posted: Thu Oct 04, 2018 12:31 pm
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.

Re: TI Function ViewMDXGet Not Working

Posted: Sun Oct 07, 2018 5:54 am
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.

Re: TI Function ViewMDXGet Not Working

Posted: Sun Oct 07, 2018 10:10 am
by Wim Gielis
No. You would have to create a traditional view based on the MDX that you get with ViewMDXGet.

Re: TI Function ViewMDXGet Not Working

Posted: Sun Oct 07, 2018 4:25 pm
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.

Re: TI Function ViewMDXGet Not Working

Posted: Sun Oct 07, 2018 5:44 pm
by lotsaram
As I said already you can’t convert a traditional view to a MDX view with ViewMDXSet. The view type is immutable.

Re: TI Function ViewMDXGet Not Working

Posted: Sun Oct 07, 2018 6:06 pm
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.

Re: TI Function ViewMDXGet Not Working

Posted: Tue Jul 30, 2019 6:57 pm
by Wim Gielis
lotsaram wrote: Thu Oct 04, 2018 12:31 pmThese views are stored as .vbx files on the server.
It's *.xbv ;-)