Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2005
    Posts
    15

    Unanswered: Is it Possible to Join 2 Queries Using MDX?

    Hi,

    First, my knowledge of MDX is very limited

    I am wondering if it is possible to return the result of 2 different queries as one. Similarly, like using UNION in SQL. I looked into the MDX UNION but it works on sets.

    Basically, I have 2 queries; one with territory sales and one with region sales. I would like to return the results of all the territories followed by the sales of the region in one go.

    Thanks in advance.

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    HUH?

    Want to post some sample code?

    Read the sticky at the top of the board
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Sep 2005
    Posts
    15
    Hi Brett,

    I am working with Reporting Services 2005 and Cubes. I create my dataset by picking my measures, dimensions and default parameters in design mode. I face the scenario now where I have two datasets but that I would like to combine them into one so that I can just output them as a list.

    I can go into MDX mode and see the MDX query generated by RS, but it is very messy and complex, and I don't think it is worth posting.

    So back to the problem, I have two MDX queries (whatever they are), that return the same columns but different rows. What I am hoping for is that there is a way to combine the MDX queries into one big query. Just like in SQL where you can use UNION to join the results of two SELECTS.

  4. #4
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    I really need to play with Reporting Services an Analysis Services...

    I suspect I do all that stuff manually in the first place
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  5. #5
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    you might be able to use UNION in sql if you use calls to OPENROWSET to fetch the rows from AS. basically union the two OPENROWSET results together.

    Like this:

    select * from OPENROWSET('MSOLAP', 'connstr', 'query1') union
    select * from OPENROWSET('MSOLAP', 'connstr', 'query2')

  6. #6
    Join Date
    Sep 2005
    Posts
    15
    Hi jezemine,

    That's big hack

    The thing is that, due to security reasons, OPENROWSET is blocked on our servers.

    Still, thanks for your input.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •