Databases Reference
In-Depth Information
COUNT (INTERSECT ( DESCENDANTS ( IIF ( HIERARCHIZE
(EXISTS[Employee].[Employee].MEMBERS,
STRTOMEMBER
("[Employee].[login].[login].&["+USERNAME"]")),
POST).ITEM (0).ITEM (0).PARENT.DATAMEMBER is
HIERARCHIZE (EXISTS ([Employee].[Employee].MEMBERS,
STRTOMEMBER
("[Employee].[login].[login].&["+USERNAME+"]")),
POST).ITEM (0).ITEM (0),
HIERARCHIZE (EXISTS ([Employee].[Employee].MEMBERS,
STRTOMEMBER
("[Employee].[login].[login].&["+username+"]")),
POST).ITEM (0).ITEM (0).PARENT,
HIERARCHIZE (EXISTS ([Employee].[Employee].MEMBERS,
STRTOMEMBER
("[Employee].[login].[login].&["+USERNAME+"]")),
POST).ITEM (0).ITEM (0))
).ITEM (0) , Employee.Employee.CURRENTMEMBER)) > 0
The above example is a cell security MDX expression to allow employees to
see Sales information made by them or by the employees reporting to them
and not to other employees. This MDX expression uses several MDX func-
tions (you learn some of these in the next section). You can see that this is
not a simple MDX expression. The above MDX expression returns a value
"True" or "False" based on the employee that is logged in, and Analysis Ser-
vices provides appropriate cells to be accessed by the employee based on
the evaluation. This example is analyzed in more detail in Chapter 18 .
MDX has progressed extensively since its birth and you can pretty quickly
end up with a complex MDX query or MDX expression like the one shown
above in Example 3. There can be multiple people working on implementing a
solution and hence it is better to have some kind of documentation for the
queries or expressions. Similar to programming languages where you can
embed comments, MDX supports commenting within queries and MDX ex-
Search WWH ::




Custom Search