Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9121025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:45:55+00:00 2026-06-17T05:45:55+00:00

I have two queries which I would like to join together,which would give me

  • 0

I have two queries which I would like to join together,which would give me the calculated total of the row. The problem I have is that although the measures are from 1 fact table the Squad names are in two role playing dimensions. I’m extremely new to MDX.

The outcome would be something like

 | Competition    | Squad   | Goals A | Goals B | Total (Goals A + Goals B)|
 |----------------|---------|---------|---------|--------------------------|
 | Premier League | Arsenal | 25      | 15      | 40                       |

Thanks in advance.

Query1:

SELECT 
([Measures].[Goals A]) ON COLUMNS,
NON EMPTY ([Dim Competition].[Hierarchy].[Competition ID],[Squad A].[Squad Name].ALLMEMBERS) ON ROWS
FROM 
[FDC Star]
WHERE [Dim Competition].[Competition ID].&[1];

Query1 result:

Competition     Squad                 Goals A
Premier League  Arsenal                 25
Premier League  Aston Villa              8
Premier League  Chelsea                 22
Premier League  Everton                 17
Premier League  Fulham                  17
Premier League  Liverpool               17
Premier League  Manchester City         25
Premier League  Manchester United       28
Premier League  Newcastle United        13
Premier League  Norwich City            13
Premier League  Queens Park Rangers      8
Premier League  Reading                 15
Premier League  Southampton             15
Premier League  Stoke City              14
Premier League  Sunderland              11
Premier League  Swansea City            19
Premier League  Tottenham Hotspur       17
Premier League  West Bromwich Albion    17
Premier League  West Ham United         19

Query2:

SELECT 
([Measures].[Goals B]) ON COLUMNS,
NON EMPTY ([Dim Competition].[Hierarchy].[Competition ID],[Squad B].[Squad Name].ALLMEMBERS) ON ROWS
FROM 
[FDC Star]
WHERE [Dim Competition].[Competition ID].&[1];

Query2 result:

Competition     Squad                 Goals B
Premier League  Arsenal                 15
Premier League  Aston Villa              9
Premier League  Chelsea                 17
Premier League  Everton                 18
Premier League  Fulham                  15
Premier League  Liverpool               17
Premier League  Manchester City         16
Premier League  Manchester United       26
Premier League  Newcastle United        14
Premier League  Norwich City            11
Premier League  Queens Park Rangers      9
Premier League  Reading                  8
Premier League  Southampton             12
Premier League  Stoke City               7
Premier League  Sunderland              10
Premier League  Swansea City            12
Premier League  Tottenham Hotspur       22
Premier League  West Bromwich Albion    12
Premier League  West Ham United         5
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T05:45:56+00:00Added an answer on June 17, 2026 at 5:45 am

    After spending many hours trying to come up with a solution I have finally solved my query.

    Thanks

        WITH  
        MEMBER [Measures].[GFA] AS 
        (
        ([Measures].[Goals A]),
        linkmember([Dim Squad].[Squad Name],[Squad A].[Squad Name]),
        root([Squad Name])
        )
        MEMBER [Measures].[GFB] AS 
        (
        ([Measures].[Goals B]),
        linkmember([Dim Squad].[Squad Name],[Squad B].[Squad Name]),
        root([Squad Name])
        )
        MEMBER [MEASURES].[GF] AS
        (
            [Measures].[GFA] + [Measures].[GFB]
        )
        select 
        {[Measures].[GFA],[Measures].[GFB],[MEASURES].[GF]} on 0,
        non empty [Dim Squad].[Squad Name].allmembers on 1
        from [FDC Star]
        where [Dim Competition].[Competition ID].&[1]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two queries with subqueries for dateparts which I like to join. SELECT
I have two queries which i would like to combine There are 4 tables
I have the following two queries which I want to get in one query.
I have a shell script in which I have to execute two queries (on
I have two queries that find both the Zip codes, and the States for
I have two queries that produce the same columns but different rows. The first
A quick technical question- I have two queries that output some of the same
I have a stock table and I would like to create a report that
I have two MySQL tables which look like these Teams id name abbr_name badge
Right now I have two separate queries to achieve the results but I would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.