SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Joining two queries in MDX


Joining two queries in MDX

Author
Message
Aspet Golestanian Namagerdi
Aspet Golestanian Namagerdi
SSC Eights!
SSC Eights! (888 reputation)SSC Eights! (888 reputation)SSC Eights! (888 reputation)SSC Eights! (888 reputation)SSC Eights! (888 reputation)SSC Eights! (888 reputation)SSC Eights! (888 reputation)SSC Eights! (888 reputation)

Group: General Forum Members
Points: 888 Visits: 863
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
Jim Mackenzie
Jim Mackenzie
SSC Eights!
SSC Eights! (923 reputation)SSC Eights! (923 reputation)SSC Eights! (923 reputation)SSC Eights! (923 reputation)SSC Eights! (923 reputation)SSC Eights! (923 reputation)SSC Eights! (923 reputation)SSC Eights! (923 reputation)

Group: General Forum Members
Points: 923 Visits: 728
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
Mackers
Mackers
Right there with Babe
Right there with Babe (721 reputation)Right there with Babe (721 reputation)Right there with Babe (721 reputation)Right there with Babe (721 reputation)Right there with Babe (721 reputation)Right there with Babe (721 reputation)Right there with Babe (721 reputation)Right there with Babe (721 reputation)

Group: General Forum Members
Points: 721 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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search