ssas - MDX Query to get employee ID based on their login ID -
i'm trying implement dynamic security on cube employer should able see measures associated employees under him.
i'm doing first getting login credentials of logged in user using username()
, getting descendants of user.
however , i'm having issue because descendants in employee dimension defined on empid
attribute whereas username()
gives login id attribute.
i'm not able use descendants function on login id attribute.
i.e
{descendants(strtomember("[employee].[emp id].&[3]"), , self_before_after)}
works but
{descendants(strtomember("[employee].[loginid].&[abc]"), , self_before_after)}
doesn't work.
so , how can empid
attribute based on login id ?
any ideas please ?
there multiple solutions achieving this. 1 of solutions set loginid
namecolumn [employee].[emp id]
attribute , use following query.
select {} on 0, descendants( filter ( [employee].[emp id].members, [employee].[emp id].currentmember.name = username() ) , ,self_before_after ) on 1 [your cube name]
Comments
Post a Comment