none
MDX : Total OF 3 Select Value

    Question

  • I want to get the total amount of the three "Select " statments....PLZ Help

    select non empty ([Measures].[Amount]) on columns ,    
           non empty([Dim DC].[DC Name].[DC Name].members) on rows
    From ( Select ( [Fact Payments].[Sale Ref].[Sale Ref].&[1000001057] ) On Columns 
    From ( Select ( -{[Dim Pay Type].[Pay Type Key].[Pay Type Key].&[2]} ) On Columns 
    from [Teh DW]
    ))

    select non empty ([Measures].[Amount]) on columns ,    
           non empty([Dim DC].[DC Name].[DC Name].members) on rows
    From ( Select ( [Fact Payments].[Sale Ref].[Sale Ref].&[1000001057] ) On Columns 
    From ( Select ( [Dim Pay Type].[Pay Type Key].[Pay Type Key].&[2] ) On Columns
    From ( Select ( [Dim Chq Status].[State Code].[State Code].&[1] :  [Dim Chq Status].[State Code].[State Code].&[3] ) On Columns
    from [Teh DW]
    )))

    select non empty ([Measures].[Total Amount]) on columns ,    
           non empty([Dim DC].[DC Name].[DC Name].members) on rows
    From ( Select ( [Fact Ret Sale].[Sale Ref].[Sale Ref].&[1000001057] ) On Columns 
    from [Teh DW]
    ))

    Wednesday, November 20, 2013 6:51 AM

Answers

  • Hi NafisehPanahi,

    According to your description, you want to add the results of 3 MDX queries. Here is a sample MDX query for Adventure Works cube for your reference.

    WITH MEMBER [Measures].[ONE] AS
    SUM(
    {[Product].[Category].[Category].[Accessories]},
    	 [Measures].[Sales Amount] 
    	)
    MEMBER [Measures].[two] AS
    SUM(
    {[Product].[Model Name].[Model Name].[All-Purpose Bike Stand]}
    ,	 [Measures].[Sales Amount] 
    	)
    	
    Member [Measures].[Result] AS 
    	[Measures].[ONE] + [Measures].[two]
    	
    select [Measures].[Result] ON Columns
    FROM [Adventure Works]

    Regards,

    Charlie Liao
    TechNet Community Support

    Thursday, November 21, 2013 2:05 PM
    Moderator