tags:

views:

416

answers:

2

I am using the CurrentMember function in a role's CellData expression to restrict access to a cube via a specific dimension. This is working as expected with one exception. Even if the slicer imension is used to filter out data that the role is not entitled to see, the string '#N/A' is displayed in all cells.

Only after including the dimension to which the role has restricted access in an axis are the cell's values displayed as expected.

It appears to me as if the CurrentMember function is ignoring the slicer dimension. Is this the case? How should I approach this problem?

A: 

My advice, in all seriousness, is to run away from cubes that require you to restrict access using cube values. Been there, done that, wasted too much time and still ended up with an unstable solution.

DEFINATELY do NOT use 'Roles' in OLAP.

Magnus Smith
I did eventually take your advice and removed roles from my solution.
Scott Munro
+1  A: 

It depends how you are doing your query with the filters. If you are generating a sub-query (using the top filter area in SSMS or BIDS) then the currentMember will return the All member - this is the way subqueries were designed to work. If you use the lower query are in SSMS or BIDS it will use the WHERE clause and you should see the results you expect.

And you may be better to use the dimension data tab instead of the cell data if you are just filtering by dimension members.

Darren Gosbell
I am not sure that I fully understand your solution, but I think that this would mean that my 'security' would only come into effect if I include the dimension in the query.
Scott Munro
No, security roles are always in effect, although re-reading your original post, using .CurrentMember is a bit unusual and could cause issues. I would not go as far as to say not to use Roles, but I try to avoid using cell based security. If you read the documentation it is designed to display #N/A if the value is restricted. If you want users not to see a certain set of members you should be securing using the DimensionData tab not CellData.
Darren Gosbell