Dynamic Security in Dimension Based on ANOTHER ATTRIBUTE

Answered Dynamic Security in Dimension Based on ANOTHER ATTRIBUTE

  • Friday, February 15, 2013 3:03 PM
     
     

    Dear All,

    I can get dynamic security to work for one attribute as in the following. This limits the Medical Practices a user is allowed to see.

    EXISTS([Hospital Number].[Medical Practice].members,{STRTOSET("[User].[User Name].&["+username+"]")},"Secure Medical Practice")

    But what I need is to limit hospital numbers based on Medical Practices a user is associated with --  Secure Medical Practice keeps the user-practice combinations. The proposed MDX expression for attribute security for Hospital Number looks like the following. But this doesn't work.

    NONEMPTY([Hospital Number].[Hospital Number].members, EXISTS([Hospital Number].[Medical Practice].members,{STRTOSET("[User].[User Name].&["+username+"]")},"Secure Medical Practice"))

    If I hard-code the Medical Practice, as in the following, then this works:

    NONEMPTY([Hospital Number].[Hospital Number].members, {[Hospital Number].[Medical Practice].&[ B22222]})

    Could anyone help with what is wrong with the second MDX expression?

    Thanks

    ABM


    • Edited by A_B_M Friday, February 15, 2013 3:04 PM
    •  

All Replies

  • Monday, February 18, 2013 2:01 PM
     
     Answered

    I've resolved this issue by referring to the hierarchy in the MDX expression:

    NONEMPTY([Hospital Number].[Hospital Number].[Hospital Number].members, EXISTS([Hospital Number].[Medical Practice].[Medical Practice].members,{STRTOSET("[User].[User Name].&["+username+"]")},"Secure Medical Practice"))

    I was helped by this post:

    http://cwebbbi.wordpress.com/2011/12/22/replacing-cell-security-with-dimension-security/

    • Marked As Answer by A_B_M Monday, February 18, 2013 2:02 PM
    •