Hi Nilgun,
Not sure why you're getting the error, but LinkMember() can get finicky
at times - it uses Member Keys to look up equivalent members. Since
Store 19 is the first store in
the [Store].[Store Name].Members set, it looks like there is a basic
problem in evaluating LinkMember([Store].CurrentMember, [StoreDup])].
You can also try using the name, instead of the key, as a link:
Quote:
|
Sum(Generate({[Store].CurrentMember} as S,
|
Filter([Store].[Store Name].Members,
ValidMeasure(([Measures].[StoreCount], S.Item(0),
StrToMember("[StoreDup].["
+ [Store].CurrentMember.Name + "]"))) > 0)),
iif([Measures].[Unit Sales] >= 0 And
[Measures].[Unit Sales] < 5000, [Measures].[Unit Sales], Null))
The idea of the second [StoreMap] cube is that each individual leaf
Store can be tested against the Multi-Select Calculated Member, to see
whether it is included under the selected members or not. A copy of the
[Store] dimension is needed because the Multi-Select Member is selected
on [Store] itself, so the individual Store is selected along the
identical [StoreDup] dimension. The resultant [StoreCount] is only > 0
if the tested Store is a descendant of one of the multi-select [Store]
members. So only those leaf Stores lying under the selected members are
included in the [Sales < 5K] measure calculation.
- Deepak
Deepak Puri
Microsoft MVP - SQL Server
*** Sent via Developersdex http://www.developersdex.com ***