Friday, February 17, 2012

Drilling down a recursive hierarchy

Hi,

We have two dimensions: User and Employee. Employees are recursive - each Employee can have several Employees that report to him/her and each Employee as a (or no) boss.

If a User has the right to access a specific employee he/she also has the rights to access his/her staff.

The following query returns all Employees a specific user has rights for.

select

filter([Employee].[Employee].members,[Measures].[UserEmployeeLink] > 0 ) on 0

from

[REPL]

where

([Measures].[UserEmployeeLink], StrToTuple("[User].[Login].&[XYZ]") )

How to modify this query that also all (directly and indirectly) subordinated employees of the queried employees are returned ?

There might exist cases, where a user has rights for employees at different levels, for instance for A and D.

+ B

|

A --| C

|

+ D

In this case, the query should return all, A, B, C and D.

Whishes,

Manfred

If I understand your question correctly, I think your looking for the DESCENDANTS function with the LEAVES parameter.

B.

No comments:

Post a Comment