Quantcast
Channel: SQL Server Analysis Services forum
Viewing all articles
Browse latest Browse all 14337

MDX percentage of member calculation

$
0
0

Hi

This should seem quite simple to me but I can't seem to get this.

I have the following query with calculated measures

with member measures.AssetValue as [CPM Asset Type].[CPM Upper Quartile].CURRENTMEMBER.MEMBERVALUE
member measures.amount2 as [Measures].[CPM Forecast Volume] * measures.AssetValue

SELECT NON EMPTY { [Measures].[CPM Forecast Volume],measures.amount2} ON COLUMNS,
  NON EMPTY { ([CPM Master].[CPM Project ID].[CPM Project ID].ALLMEMBERS * [CPM Outputs].[CPM Output Name].[CPM Output Name].ALLMEMBERS * [CPM Asset Type].[CPM Upper Quartile].[CPM Upper Quartile].ALLMEMBERS ) }  ON ROWS
  FROM ( SELECT ( { [CPM Master].[CPM Project ID].&[50000252] } ) ON COLUMNS
  FROM ( SELECT ( { [CPM Master].[CPM Business Unit].&[CENTRAL] } ) ON COLUMNS
  FROM ( SELECT ( { [Date].[Financial Year - Month].[Financial Year].&[2017] } ) ON COLUMNS
  FROM ( SELECT ( -{ [CPM Asset Type].[CPM Upper Quartile].[All].UNKNOWNMEMBER } ) ON COLUMNS FROM [Productivity Cube])))) WHERE ( [Date].[Financial Year - Month].[Financial Year].&[2017], [CPM Master].[CPM Business Unit].&[CENTRAL] ) 

This produces this result

I would like to calculate the percentage for each of the Project ID's

so in this example the total of amount2 = 18894

Therefore the breakdown between the 2 results would be

7204.00/18894 = 0.3812

11690/18894 = 0.6187

I've tried a couple of things but haven't found the correct answer yet.

Regards


Viewing all articles
Browse latest Browse all 14337

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>