Hi,
If I create a view with MDX and then assign it as a datasource to a view, this works well but...
If the MDX query returns no results then (as far as I can tell) I run into errors that I can not trap or suppress.
ViewCreateByMDX(sCubeName , sObjectName, sMDX, booTempOn);
#Check that the view got created (failed attempt to trap error)
If(ViewExists(sCUbeName , sObjectName)=1);
#Make the view the source
DatasourceCubeview=sObjectName;
Else;
#turn off the datafeed
DataSourceType='NULL';
EndIf;
If the MDX view returns no records I always get a fatal error "Error: Prolog procedure line (0): Unable to open data source "Plan"".
If I set booTempOn=0, then I do not see a view in PAW (after refreshing)
Anyway something seems off here.
If I have a traditional view that is empty the TI doesn't complain.
If I have a MDX view that is empty then I get a fatal error, additionally I have no way of testing to see if the view is empty to trap the fatal error.
Why do I not see the empty view in the object explorer when the ViewExists function is returning true?
I've been fiddling around with creating a union of my real query with a tuple that I know will return a cell but this adds a lot of downstream complexity in getting that record ignored when I do get results.
Anyone found a nice solution to this?
------------------------------
Steve Rowe
Technical Director, InfoCat
www.infocat.co.uk------------------------------
#PlanningAnalyticswithWatson