MDX: Retrieving same Measure based on 2 Different Dimensions in same query



Hi,



I am new to MDX and is stuck up on a problem which i feel is quite common.



We have a Cube named 'User'



Measures for the cube:

1.. M1
2.. M2
Dimensions for the cube:

1.. D1
2.. D2


Both D1 and D2 have been created as named queries from [Date Dim] table and
hence have the same number of entries and hierarchy.



Requirement:

We need to join A & B based on the equality of D1's member value and D2's
member value.



A) Select

{ [Measures].[M1], [Measures].[M2] } ON COLUMNS,

{ [D1].Members} ON ROWS

FROM [User]





B) Select

{ [Measures].[M1], [Measures].[M2] } ON COLUMNS,

{ [D2].Members } ON ROWS

FROM [User]



The corresponding SQL query which we are trying to simulate using MDX is
shown below:



Select Coalesce(a.si_SignupDateID, b.si_DeleteDateID) as Date,
Coalesce(signupcount,0) as Registrations, Coalesce(deletedcount,0) as
Deletions, (Coalesce(signupcount,0)-Coalesce(deletedcount,0)) as [Net
Change]

from

(

Select si_SignupDateID, count(*) as signupcount

from UserFact

group by si_SignupDateID

) as a full outer join

(Select si_DeleteDateID, count(*) as deletedcount

from UserFact

group by si_DeleteDateID

) as b

on a.si_SignupDateID = b.si_DeleteDateID

order by Date



Thanks for reading the message

Sumit Pilankar


.



Relevant Pages

  • Modular Arithmetic in MDX or Time Conversion Function in SSAS 2000
    ... I just created a cube in Analysis Services 2000 where I'm trying to get ... Is there a Seconds to Minutes conversion function that works in MDX, ... member's Format String property that will give me the result I want? ...
    (microsoft.public.sqlserver.olap)
  • Re: Is nested SUM get slow performance in Cube?
    ... this MDX is quite heavy. ... The target of my cube was to Calculate the Remaining in an Inventory process. ... if in a store the SystemStock says must be 30 Adidas shoes, and I found 35, I ... SS RS Remainig ...
    (microsoft.public.sqlserver.olap)
  • Re: Performance problem with large dimension and OWC
    ... I'll do some traces and see if I can get to the bottom of it. ... Problem is the MDX that OWC generates is quite confusing and heavily uses session sets. ... We have built a simple OWC interface for our users to browse the cube, but have noticed that there are some severe performance problems when our users drill down from the seventh level to the eighth level of the customer hierarchy. ...
    (microsoft.public.sqlserver.olap)
  • Re: MDX Lagerzahlen =?ISO-8859-1?Q?f=FCr_Zeiten_ohne_aktiv?= =?ISO-8859-1?Q?it=E4t?=
    ... ich bin recht neu in dem Bereich MDX und ich wollte mal fragen ob es ... Also ich habe einen Cube in dem ich eine Kennzahl "Vorhandener ... aber ich würde es (beim schreiben der Faktentabelle) vor dem Laden des Cubes tun ... Falls Du doch berechnen willst - definiere das ganze als "calculated Cell" im Cube und verbiete die ...
    (microsoft.public.de.sqlserver)
  • Re: MDX for calc measures based on level members
    ... I added my MDX sample as Cube Calculated Member and see the ... I tested the same thing at the "Filter pane". ...
    (microsoft.public.sqlserver.olap)

Loading