Solved

# MDX Calculation - % of All

Posted on 2011-02-18
920 Views
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:

[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
Question by:derekkromm
1 Comment

LVL 15

Accepted Solution

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

Question has a verified solution.

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

### Suggested Solutions

SQL Server Generate Scripts Fails 5 36
Help in Bulk Insert 9 35
SQL Syntax: How to force case sensitive query? 2 30
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.