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 901187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:30:59+00:00 2026-05-15T15:30:59+00:00

We use a cube built in SSAS and we would like to show the

  • 0

We use a cube built in SSAS and we would like to show the effect of deltas against a forecast.

So, we have data like this:

Year    Type        Amount
----    ---------   ---------
2008    Forecast    +1000
2008    Delta 1     - 100
2008    Delta 2     - 200
2009    ...

We would like to make a stacked bar chart, so we need data like this:

Year    Type        Amount
----    ---------   ---------
2008    Result      +700
2008    Delta 1     +100
2008    Delta 2     +200

You can see that ‘Result’ equals the sum of forecast and the deltas, at a particular granularity (in this this example case it is just time, we will also have place as an added dimension).

The catch is we’d like to be able to filter out a delta and have the bar chart update, so then ‘Result’ would need to then to change so that the sum is still the forecast for that granularity:

Type          Amount
---------   ---------
Result         +900
Delta 1        +100

We could do this in a view, but then we’d have to generate a result for every possibility of delta selects and deselects, which doesn’t seem optimal.

Is there a way to do this in the cube? Our best guess is some kind of MDX calculated member but we are open to other solutions as well.

Thanks!

UPDATE 1:
The problem I see with a calculated field is that it adds a member (i.e. a column) to the cube, where what we really need to do is add rows with a UNION…but in a cube. Here’s some psuedo SQL as an example:

SELECT 
  Year,
  'Result' AS Type,
  SUM(Amount) AS Amount
FROM Table1
WHERE 1=1
  --AND Type 'Delta 2' 
GROUP BY Year

UNION ALL

SELECT 
  Year,
  Type,
  -1*Amount AS Amount
FROM Table1
WHERE Type LIKE 'Delta%'
  --AND Type 'Delta 2'

--Note the commented out WHERE clauses are where you would de-select a delta if desired.

Can that be translated to MDX for an on the fly calculation?

UPDATE 2:

This is the closest I’ve gotten so far, but it’s not perfect:

CREATE MEMBER CURRENTCUBE.[Measures].[Adjusted]
 AS CASE [Measure Type DEV].[Measure Type] /* This is the 'Type' column above */
    WHEN [Measure Type DEV].[Measure Type].&[2] /* Forecast is key 2 */
    THEN ([Measure Type DEV].[Measure Type].&[2],
        [Time].[Year].CURRENTMEMBER,[Measures].[Amount]) 
      + ([Measure Type DEV].[Measure Type].&[3], /* Delta is key 3 */
         [Time].[Year].CURRENTMEMBER,[Measures].[Amount]) END
  • 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-15T15:31:00+00:00Added an answer on May 15, 2026 at 3:31 pm

    In my last update to the question (Update 2) I asked how to do a SQL like union in MDX…which led me in the right direction but is the wrong way of thinking about it (I’m still new to MDX).

    To add that Result ‘Row’ I needed to add a calculated dimension (which can be put ON ROWS), that returned the All level, which does the summation I was looking for, AND I needed to add a new calculated dimension that would do the case statement (flip the reductions in one case, subtract the reductions from the total in the other).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We use a data acquisition card to take readings from a device that increases
I use a stream reader to import some data and at the moment I
'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move
Use case: A does something on his box and gots stuck. He asks B
Use case: 3rd party application wants to programatically monitor a text file being generated
I use Firebug and the Mozilla JS console heavily, but every now and then
I use rsync to synchronize files to Windows clients in a server agnostic way.
I use emacs to edit my xml files (nxml-mode) and the files were generated
I use the VS2008 command prompt for builds, TFS access etc. and the cygwin
We use QuickBooks for financial management, and feed it from a variety of sources.

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.