![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
X1Y1Z3 | 7 | 4.66% X1Y2Z3 | 6 | 4.00% X2Y2Z3 | 5 | 3.33% Total | | 150 | 100.00% |
|
X1Y1Z3 | 7 | 3.50% X1Y2Z3 | 6 | 3.00% X2Y2Z3 | 5 | 2.50% Total | | 150 | 75.00% |
#2
| |||
| |||
|
|
Hello OLAP List, I am new to AS, OLAP and MDX and would really appreciate a bit of help with percent-to-total calculated measures. I have read through many of the list samples and tried some that seem applicable, but I still have not been able to solve my problem. I will do my best to describe my scenario, so if you have any questions or my syntax is incorrect please let me know. I have a snowflaked dimension called Attributed Class that details levels of granularity about responsibility and failure modes for "Returns". The Attributed Class Dimension is as follows: Attributed Class: + Attributed Class ++ Z Code ++ XYZ Code Also, I have a measure called "Returns Last Wk". What I want to generate is 2 separate reports (in Reporting Services) that handle the dimensionality of the denominator in the calculated "Percent Returns Last Wk" differently based on the situation. Here are the desired reports: Report 1 - Returns by Attributed Class Attributed Class | Returns Last Wk | Percent Returns Last Wk ------------------------------------------------------------- US* | 150 | 75.00% Customer | 30 | 15.00% Process | 12 | 6.00% No Defect | 8 | 4.00% Total | 200 | 100.00% *the use of US throughout this thread refers to "our" fault. It does not refer to the United States (US) geography. Report 2 - Returns by Z,XYZ Code (US) Z Code | XYZ Code | Returns Last Wk | Percent Returns Last Wk -------------------------------------------------------------------- +Z1 | | 100 | 66.66% +Z2 | | 32 | 21.33% -Z3 | | 18 | 12.00% | X1Y1Z3 | 7 | 4.66% | X1Y2Z3 | 6 | 4.00% | X2Y2Z3 | 5 | 3.33% Total | | 150 | 100.00% So, I have the first report completed. MDX: select {[Measures].[Returns Last Wk], [Measures].[Percent Returns Last Wk]} on columns, non empty {order({[Attributed Class].children}, ([Measures].[Returns Last Wk]), DESC)} on rows from [MyCube] where ([Product].[All Product].[Gizmos], [Source].[All Source].[valid]) and the calculated measure is easy: [Measures].[Returns Last Wk]/([Measures].[Returns Last Wk],[Attributed Class].[All Attributed Class]) The second report is what is stumping me. I was hoping to be able to use a single calculated measure include in both reports, but at this point I would be happy with any solution that gets me going again. Currently, if I use the same calculated member the denominator is [Attributed Class].[All Attributed Class] and not just a particular Attributed Class, [Attributed Class].[All Attributed Class].[US], for example: Z Code | XYZ Code | Returns Last Wk | Percent Returns Last Wk -------------------------------------------------------------------- +Z1 | | 100 | 50.00% +Z2 | | 32 | 16.00% -Z3 | | 18 | 9.00% | X1Y1Z3 | 7 | 3.50% | X1Y2Z3 | 6 | 3.00% | X2Y2Z3 | 5 | 2.50% Total | | 150 | 75.00% This report should Total to 100.00% not the US contribution of 75.00% from Report 1. If it makes a difference, this is going in to Reporting Services, so the dataset will be rendered as a flattened recordset format. Cheers! |
#3
| |||
| |||
|
|
X1Y1Z3 | 7 | 38.89% X1Y2Z3 | 6 | 33.33% X2Y2Z3 | 5 | 27.78% Total | | 150 | 75.00% |
|
X1Y1Z3 | 7 | 4.66% X1Y2Z3 | 6 | 4.00% X2Y2Z3 | 5 | 3.33% Total | | 150 | 100.00% |
#4
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |