Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

[MDX, SCOPE()] How to correctly replace value of ( [Some Dimension].[All], [Some Measure] )?

$
0
0

I'm using SQL Server Analysis Servises 2008 R2.

I need to replace the value of [Some Dimension].[All] when calculated against [Some Measure]. Here's what I have tried:

SCOPE( [Some Dimension].[All] );
  [Measures].[Some Measure] = 123; // for simplicity sake
END SCOPE;

This works as expected when I query against [Some Dimension] – the [All] member returns 123, and other members are untouched, showing the actual associated [Some Measure] values.

But for some strange reason, all of the members in all other dimensions now return 123 for [Some Measure]. I am really lost. Please advice me how to fix this, and why this is happening.

For the ones who are curious: the reason I want to replace the value of [All] is because [Some Dimension] and [Some Measure] are related as many-to-many. Because of this, tuple ( [Some Dimension].[All], [Some Measure] ) always returns the total count for [Some Measure] in the cube. What I want it to return is the count of [Some Measure] that are actually associated with at least one member of [Some Dimension].




Viewing all articles
Browse latest Browse all 2472

Trending Articles



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