SSAS role security on measure with scope statement - Reply ASAP

  • role security cant be applied on calculated measure so i created calculated measures from this link

    http://adamjorgensen.wordpress.com/2010/02/21/applying-security-to-calculated-measures/

    i.e creating a named calculation in DSV with initial value = 0, adding it as a new measure. and then writing a scope statement even with a simple assignment like

    SCOPE ([Measures].[SaleVal]);

    THIS= 2;

    END SCOPE;

    now i was able to view it in 'dimension data' of role security. but when i exclude it from viewing in this role and on browsing cube as a user of this role. i get the following error

    "MdxScript ... the END SCOPE statement does not match the opening SCOPE statement. Mdx Script ... the [SaleVal] member was not found in the cube when the string is parsed"

    i overcome this error by setting ScriptErrorhandlingMode=IgnoreAll. but i dont found it a reasonable way. is there anyotherway to overcome this problem.

    Thanks in Advance

  • For anyone interested, this article offers a great way overcome the above issue ( "SCOPE...member was not found" ) :

    http://cwebbbi.wordpress.com/2008/01/22/dimension-security-tips-tricks-and-problems/

  • I used bits from both, and came up with a solution.

    My issue was I had a role setup that I wanted to have denied a calculated member to a user group. So, I started with the first link and ran into the same error when I opened the file using a low level access domain account.

    I used Adam's post, but in Step 3 I entered:

    SCOPE (IIF(iserror(strtomember("Measures.[Average Test]")),|a measure no user would be denied|,Measures.[Average Test]));

    if not(iserror(strtomember("Measures.[Average Test]"))) then

    THIS = |WHATEVER I WANT TO CALC!|

    end if;

    END SCOPE

    Had a bit of redundancy, but was needed for some reason. Was finally able to shut off a calculated member for a certain access level. I was having trouble in testing because my domain user had server role access. When I logged into my computer with a lower level access I was able to open my excel report and not see the field Average Test, of which I did not want. I am now moving all my calculated members over from calculated members to named calculations.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply