Solved

MDX Calculation - % of All

Posted on 2011-02-18
1
922 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
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

820 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