Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Joining two queries in MDX Expand / Collapse
Author
Message
Posted Wednesday, February 10, 2010 5:22 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, February 13, 2014 3:33 PM
Points: 179, Visits: 726
I have two queries that has been implemented in MDX for different dates:

SELECT NON EMPTY { [Measures].[Quantity Received] } ON COLUMNS,
non empty {([Customer - ID].[Customer - ID],[Entry Date Time].[01/01/2008])} ON ROWS
FROM [Sales]

SELECT NON EMPTY { [Measures].[Quantity Received] } ON COLUMNS,
non empty {([Customer - ID].[Customer - ID],[Entry Date Time].[01/02/2008])} ON ROWS
FROM [Sales]

The only difference of these two queries is on their Entry Date Time
Now I want to join these table so I will have result like this

CustomerID EntryDateTime QuantityRecieved EntryDateTime QuantityRecieved
12 01/01/2008 12 01/02/2008 13

Is this doable and also can I chnage the caption of the column on the result Set.Because now I have duplicate EntryDateTime,QuantityRecieved.


Thanks
Post #863735
Posted Thursday, October 25, 2012 2:38 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Today @ 5:28 AM
Points: 321, Visits: 570
I'm trying to do pretty much the exact same thing.

You could create calculated members for each of the [date/time],[Measure] combinations and return them all, but I'm trying to avoid doing that.

I'll post back if I find anything.


SQL SERVER Central Forum Etiquette
Post #1376839
Posted Thursday, October 25, 2012 3:20 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, January 13, 2014 7:34 AM
Points: 117, Visits: 499
I don't understand why you'd need to join two MDX queries together. In the above example wouldn't you just have a set with the multiple dates you want to select.

Like

SELECT NON EMPTY { [Measures].[Quantity Received] } ON COLUMNS,
non empty {[Customer - ID].[Customer - ID].[All].Children}
* {[Entry Date Time].[01/01/2008],[Entry Date Time].[01/02/2008]} ON ROWS
FROM [Sales]

Am I missing something?
Mack
Post #1376859
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse