Since I have not made any progress with finding the right syntax I thought about a
CASE statement. This works in MS Analysis Services but I am not sure if it does with SAS OLAP.
CASE 'SUB::SAS.IdentityGroups' AS var
WHEN var CONTAINS 'SalesTeamLead' THEN
'agent should see all descendants of the group he/she is part of'
WHEN var CONTAINS 'SalesPerson' THEN
Ancestors(Head(Filter([DIM_SALES].AllMembers,[DIM_SALES].CurrentMember.Level.Name = 'SALESAGENT' and [DIM_SALES].CurrentMember.Name = 'SUB::SAS.Userid')).Item(0))
END
Original:
CASE [input_expression]
WHEN when_expression THEN when_true_result_expression
[...n]
[ELSE else_result_expression]
END
http://msdn.microsoft.com/en-us/library/ms144841.aspx
SAS.IdentityGroups returns multiple values so we need to check if one of them is x. There is a SAS tutorial but it only shows how to add an identity driven property to an mdx expression not how to use those as part of an expression
http://support.sas.com/documentation/cdl/en/olapug/59574/HTML/default/viewer.htm#a003212399.htm