tags:

views:

74

answers:

1

I have an MDX query which returns the following tuples:

Dim1A, Dim11, Dim21, Measure1A, Measure11, Measure21
Dim1A, Dim12, Dim22, Measure1A, Measure12, Measure22
Dim1A, Dim13, Dim23, Measure1A, Measure13, Measure23
Dim1A, Dim14, Dim24, Measure1A, Measure14, Measure24
....
....
Dim2A, Dim11, Dim21, Measure2A, Measure11, Measure21
Dim2A, Dim12, Dim22, Measure2A, Measure12, Measure22
Dim2A, Dim13, Dim23, Measure2A, Measure13, Measure23
Dim2A, Dim14, Dim24, Measure2A, Measure14, Measure24

The Measure1A, Measure2A gets repeated for Dim1A, Dim2A and if I have a large set the query response time is slow since Measure*A is an involved calculation. My question is how can I prevent Measure*A from getting computed 4 times for each Dim*A. So in the above example Measure1A gets calculated 4 times and so does Measure2A. Ideally I would like them to be computed once for each unique Dim*A

A: 

You could try using a query scoped calculated member, if possible with your query. As long as you don't include the currentmember in the calculation it will only get calculated once. Whether this is possible or not will depend on how complex your query is and whether you have a lot of measures to add (Measure1A, Measure2A, Measure3A, etc)

Something like:

WITH 
   MEMBER [Measures].[Measure1a] AS ....your calculation....
SELECT 
 ..... your query
TskTsk