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

  • SEARCH
  • Home
  • 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 3344768
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:06:27+00:00 2026-05-18T01:06:27+00:00

Im having an issue with an MDX query, and I think it boils down

  • 0

Im having an issue with an MDX query, and I think it boils down to the order of precedence between calculating an aggregate and a calculated member.

Let me start with the underlying data, which revolves around a valuation (which has a date, and some other data such as a member type, a scheme – and crucially for this question; a loading factor) and an associated value.

The data

Valuation Table

Id | Valuation Date | Member Type | Scheme   | Loading Factor
=============================================================
1  | 2010-01-01     | TypeA       | Scheme X | 0.02
2  | 2010-01-01     | TypeB       | Scheme X | 0.02
3  | 2010-01-01     | TypeA       | Scheme Y | 0.02
4  | 2010-01-01     | TypeB       | Scheme Y | 0.02

ValuationValue table

ValuationId | Value
====================
1           | 1000.0
2           | 2000.0
3           | 3000.0
4           | 4000.0

This, when loaded into a cube has a Valuation dimension with attributes MemberType, Scheme and date. And a cube with Measure group ValuationValue containing Value measure, and a Valuation measure group containing Loading Factor like so:

Cube
 -Measure Groups
  - Valuation
    |_Loading Factor
  - ValuationValue
    |_Value
 - Dimensions
  - Valuation
    |_MemberType
    |_Scheme
    |_Date

The question

Loading factor is used to load the Value, think of it like a tax, so 0.02 means “Loading amount is 2% of the value”. When returning Value from a query, I need to also calculate the amount to load this value by. A typical query might look like

SELECT
{
 [Measures].[Value] 
} ON 0,
[Valuation].[Scheme] ON 1
FROM Cube

This would return 2 rows, and as you can see by comparing to the data above it correctly sums across memberType:

Scheme   | Value
=================
Scheme X | 3000.0
Scheme Y | 7000.0

Now, if I try to calculate my loading factor in that query, all goes wrong – i’ll demonstrate. Given the following query:

WITH MEMBER [Measures].[Loading Value]
AS
(
   [Measures].[Value] * [Measures].[Loading Factor]
)
SELECT
{
 [Measures].[Value] ,
 [Measures].[Loading Value]
} ON 0,
[Valuation].[Scheme] ON 1
FROM Cube

I get the result

Scheme   | Value  | Loading Value
=================================
Scheme X | 3000.0 | 120.0
Scheme Y | 7000.0 | 280.0

Basically, what is happening is that it is suming my Loading Factor and then multiplying that by the Sum of my values(The first row above should be 1000 * 0.02 + 2000 * 0.02 = 60. Instead it’s calculating 3000 * 0.04 = 120).

This is of course a contrived example, my actual structure is a bit more complex – but I think this demonstrates the problem. I was under the impression that the calculated member in the example above should occur on a row-by-row basis, instead of at the end of an aggration of my Value measure.

Thanks for any replies.

  • 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-05-18T01:06:28+00:00Added an answer on May 18, 2026 at 1:06 am

    Thes one turned out ot be REALLY easy.

    WITH MEMBER [Measures].[Loading Value]
    AS
    (
       [Measures].[Value] * [Measures].[Loading Factor]
    )
    WITH MEMBER [Measures].[Total Loading Value]
    AS
    SUM (
      EXISTING [Valuation].[Id].[Id],
      [Measures].[Loading Value]
    )
    SELECT
    {
     [Measures].[Value] ,
     [Measures].[Measures].[Total Loading Value]
    } ON 0,
    [Valuation].[Scheme] ON 1
    FROM Cube
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having an issue with a query that currently uses LEFT JOIN weblog_data AS
I’m having an issue where a drop down list in IE 6/7 is behaving
I'm having an issue with my regex. I want to capture <% some stuff
I'm having an issue with a Flash/Flex erroring in Firefox but not IE. I
I am having an issue where Tomcat is treating extra path information as part
I'm having an issue with a standard ASP.NET page that has a TextBox and
I'm having an issue with CruiseControl.net where the web dashboard just won't work in
I'm having an issue with expressions within reports. I'm coloring the background of a
I'm having an issue dragging a file from Windows Explorer on to a Windows
I'm having an issue setting up one of my projects in TeamCity (v4.0), specifically

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.