Using M, MDX, and strings in OLAP

  • Using M, MDX, and strings in OLAP

    Posted by DSC Communities on January 23, 2018 at 2:59 pm
    • Peter Globus

      Member

      January 23, 2018 at 2:59 PM

      I have a large OLAP cube, that I am looking to dynamically filter data on prior to loading into Power BI.

      I want users to have the option of entering 1 or multiple items in the filter. To solve this, I created a parameter where users can enter comma delimited values. I then take this parameter and do the following using M and MDX:

      1. Generate a list from the parameter string (Text.Split(myParameter,”,”)
      2. Create the necessary MDX text surrounding parameter values to add as a filter.
      3. Store the result in a string.

      I then take the result string and add it to the query string at the correct area. If I create this string outside the query and enter the literal information everything works fine. If I use the string variable, I get the following error:

      DataSource.Error: An error happened while reading data from the provider: ‘Object reference not set to an instance of an object.’ SQL Server OLAP

      DataSource.Error: An error happened while reading data from the provider: 'Object reference not set to an instance of an object.' SQL Server OLAP
      Is there a limitation for using M language in a Native Query when using OLAP, and if so, is there a workaround that will not be too painful to the end user?

      ——————————
      Peter Globus
      ——————————

    • Peter Globus

      Member

      January 23, 2018 at 5:04 PM

      After further testing, I confirmed the error I am seeing is unrelated to the string and OLAP. The actual cause is that no rows are returning for the items I initially included. Lesson learned. šŸ™‚

      ——————————
      Peter Globus
      ——————————
      ——————————————-

    • Audrey Abbey

      Member

      January 23, 2018 at 7:31 PM

      Lesson SHARED and that is what is important.Ā 

      Error messages are so vague, lol.

      ——————————
      Audrey Abbey
      SR. BI Developer/Analyst
      New Seasons Market
      Portland OR
      ——————————
      ——————————————-

    DSC Communities replied 7 years, 8 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Using M, MDX, and strings in OLAP’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!