Planning Analytics

 View Only
  • 1.  ViewCreateByMDX - Using as a datasource

    Posted Wed April 29, 2020 05:11 AM
    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


  • 2.  RE: ViewCreateByMDX - Using as a datasource

    Posted Thu April 30, 2020 03:47 AM
    I found an answer on the tm1forum

    https://www.tm1forum.com/viewtopic.php?f=3&t=14797&p=73290&hilit=viewmdxset#p73290

    Would be nice not to have to employ these workarounds.

    The solution is 
    1.  In the MDX do your cross join excluding the non-empty
    2.  Then zero suppress the view using the command for the old style views.

    Any views as to a performance it doing it this way around rather than doing a non empty cross join?

    ------------------------------
    Steven Rowe
    ------------------------------



  • 3.  RE: ViewCreateByMDX - Using as a datasource

    Posted Thu April 30, 2020 03:53 AM

    There is an open APAR to have this fixed: https://www.ibm.com/support/pages/apar/PH16537

    ------------------------------
    Tim Ryan
    ------------------------------



  • 4.  RE: ViewCreateByMDX - Using as a datasource

    Posted Thu April 30, 2020 08:44 AM
    Thanks for the update Tim, though I see it has been in the queue for a while...

    ------------------------------
    Steven Rowe
    ------------------------------