[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

MDX Calculation - % of All

Posted on 2011-02-18
1
Medium Priority
?
929 Views
Last Modified: 2016-02-15
I'm trying to find an easier way to accomplish the following:

I have a calculated member called StaffingRate. It should return the % of Headcount as compared to the entire dataset based on where you've drilled.

So for example, lets say the total headcount for a given time period is 50. At the top level it should be 100%. If I drill into an org chart, it should return a % of the whole. Lets say a chart looks like A->B/C. B->D. C->E/F. A should always be 100%. If there is a Headcount of 10 at F, it should be 20% when I drill down to that level. I hope this makes sense.

The way I'm currently doing this is by first creating a calculated member called Headcount All Level that looks like:

CREATE MEMBER CURRENTCUBE.[MEASURES].[Headcount All Level]
 AS ([Measures].[Headcount],
[Age Band].[Age Band].[All Age Bands],
[Employee].[Employee].[All Employees],
.... etc

Where I list out every "All" dimensional level. And then my Staffing Rate member = Headcount / Headcount All Level

There has to be a better/more efficient way to handle this, right?
0
Comment
Question by:derekkromm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 15

Accepted Solution

by:
derekkromm earned 0 total points
ID: 34957911
Ok, I figured out a workaround.

I totaled the measure at the lowest time grain in the SQL layer.

Then I added that as a measure to the cube twice: once with sum aggregation and once with count.

Then I created a calculated member that did sum / count to get back to the desired #.
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question