David_Lindley


Hi,

I am trying to create a calculated measure, but since I am new to MDX, I have no idea how to go about it.

I have two measure groups. One contains the number of customers recruited and is associated with one dimension (Start Week number). The other measure group contains the amount of of sales () and has two dimensions (Start Week number + Actual week number).

What I want to do is create a calculated measure of sales amount per customer recruited. The number of recruited customers will obviously be constant for any given start week, and the sales amount will be different for each actual week.

Could anybody advise on a way to do this.

Many thanks,

Dave




Re: MDX Calculated Member Problem

Greg Guzik


Here is a simple example of a calculated member (measure) in the query scope that calculates sales amount per customer:

WITH MEMBER Measures.x as '[Measures].[Sales Amount]/[Measures].[Customer Count]'
SELECT Measures.x ON 0 From [Adventure Works]
WHERE [Date].[Fiscal Year].&[2002]

In WHERE clause I'm slicing through time. In your case you can use a condition that utilizes Start Week and Actual Week.







Re: MDX Calculated Member Problem

David_Lindley

Thanks Greg, that did the trick.