Databases Reference
In-Depth Information
Scope ([Store].[Stores].[Store Country].[USA]);
Scope([Store].[Store State].[WA]);
//Scope is on ([Store].[Stores].[Store Country].[USA],
// [Store].[Stores].[Store State].[WA]);
This = 1;
End Scope;
End Scope;
.
An attribute specified by a nested
Scope
statement overwrites its relating attribute
with the member
ALL
. (The
relating
attribute is the one below the current attribute.)
For example, in the following
Scope
statements, the parent
Scope
statement has a
slice on the
State
attribute and the nested
Scope
statement has a slice on the
Country
attribute. The statements overwrite the
State
attribute, which is relating to
Country
, and assign the value
1
to the subcube that corresponds to
USA
and not to
Washington
:
Scope([Store].[Store State].[WA]);
Scope ([Store].[Stores].[Store Country].[USA]);
//scope is on ([Store].[Stores].[Store Country].[USA],
// ([Store].[Store State].[(All)]);
This = 1;
End Scope;
End Scope;
.
If the member
ALL
is not specified for an attribute in the nested
Scope
statement, but
the parent
Scope
statement has a member
ALL
for the attribute related to the current
one, the member
ALL
is removed from the subcube. The following two examples
demonstrate this rule:
Scope ([Store].[Store Country].Members);
Scope([Store].[Store State].[Store State].Members);
// Nested scope requested all members from level Store State of the
// hierarchy Store State (not including member ALL)
//The parent scope requested all members from the hierarchy Store
➥
Country,
// including member ALL.
//Now the member ALL is removed from the Store Country and scope is
➥
on
// ([Store].[Store Country].[Store Country].Members,
//([Store].[Store State].[Store State].Members)
This = 1;
End Scope;
End Scope;
Search WWH ::
Custom Search