Hello all:
New to mdx.
I am having a terrible time creating MDX query to resolve the weighted average.
I have an "Officer" dimension with following levels
CREATE TABLE [dbo].[Officer_Dim] (
[Holding_Company] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Affiliate] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Team] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL.
[Officer] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL)
Holding Company is highest level.
Officer is the lowest level.
"Risk" Dimension has following levels:
CREATE TABLE [dbo].[Risk_Score_Dim] (
[Category] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Sub_Category] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Risk_Code] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Risk_Score] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL)
Category is highest level, Risk_Score is lowest.
Also have a Measure, which is "Principal Balance".
I need to do a WEIGHTED average of OFFICER by RISK SCORE, weighted on (measure) prinicpal balance.
Calcualtion would be as follows:
sum(Principal Balance * Risk_Score)/sum(Total Principal Balance for OFFICER)
Should I create a calculated measure for sum(Principal Balance * Risk_Score), then use this in an MDX query?
Should I do the same for sum(Total Principal Balance for OFFICER) ?
Any example or help will be GREATLY appreciated.
Having problem understanding an advanced mdx query and how to apply such a query in the cube editor.
Thanks again!
Sincerley,
mzimm
New to mdx.
I am having a terrible time creating MDX query to resolve the weighted average.
I have an "Officer" dimension with following levels
CREATE TABLE [dbo].[Officer_Dim] (
[Holding_Company] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Affiliate] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Team] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL.
[Officer] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL)
Holding Company is highest level.
Officer is the lowest level.
"Risk" Dimension has following levels:
CREATE TABLE [dbo].[Risk_Score_Dim] (
[Category] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Sub_Category] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Risk_Code] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Risk_Score] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL)
Category is highest level, Risk_Score is lowest.
Also have a Measure, which is "Principal Balance".
I need to do a WEIGHTED average of OFFICER by RISK SCORE, weighted on (measure) prinicpal balance.
Calcualtion would be as follows:
sum(Principal Balance * Risk_Score)/sum(Total Principal Balance for OFFICER)
Should I create a calculated measure for sum(Principal Balance * Risk_Score), then use this in an MDX query?
Should I do the same for sum(Total Principal Balance for OFFICER) ?
Any example or help will be GREATLY appreciated.
Having problem understanding an advanced mdx query and how to apply such a query in the cube editor.
Thanks again!
Sincerley,
mzimm