title: MDX: joining two sets on same member of several dimensions?
body: <p>Is is possible in MDX to combine results of two queries based on the same member of several dimensions? </p>
  
  <p>In my case:
  There are two types of reports BuyersReports and SellersReports, e.g</p>
  
  <p>BuyersReports</p>
  
  <pre><code>Buyer Seller Amount
  A     B      10
  B     C      20
  </code></pre>
  
  <p>SellersReports</p>
  
  <pre><code>Seller Buyer Amount
  B      A     10
  C      B     15
  </code></pre>
  
  <p>Each company (A,B,C) coulb be both buyer and seller.</p>
  
  <p>I need to achieve some kind of this:</p>
  
  <pre><code>  Buy Sell-To (Diff1) Sell Buy-From (Diff2)
  B 20  15      5       10   10        0
  </code></pre>
  
  <p>Currently I have two measures: [Buyings] and [Sellings], and two instances of the same dimension of companies: [Buyers] and [Sellers]. </p>
  
  <p>I can get both parts of the desired query for company "B":</p>
  
  <pre><code>SELECT 
  [Measure].[Buyings],[Meausure].[Sellings] ON COLUMNS,
  [Buyers].[Name], [Sellers].[Name] ON ROWS
  FROM 
  (
  SELECT [Buyers].[Name].&amp;[B] ON COLUMNS
  FROM MyCube
  )
  </code></pre>
  
  <p>gives me</p>
  
  <pre><code>B C 20 15
  </code></pre>
  
  <p>And</p>
  
  <pre><code>SELECT 
  [Measure].[Buyings],[Meausure].[Sellings] ON COLUMNS,
  [Buyers].[Name], [Sellers].[Name] ON ROWS
  FROM 
  (
  SELECT [Sellers].[Name].&amp;[B] ON COLUMNS
  FROM MyCube
  )
  </code></pre>
  
  <p>with result</p>
  
  <pre><code>A B 10 10
  </code></pre>
  
  <p>Is it possible to combine results of these two queries to achieve combined buyer-seller report for each company?</p>