<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic MDX code for authorization in a cube in SAS Web Report Studio</title>
    <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/MDX-code-for-authorization-in-a-cube/m-p/87413#M1571</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi!&lt;/P&gt;&lt;P&gt;I would like to add a authorization for people belonging to certain groups in a olap cube to be used for a wrs-report, one person can belong to multiple groups. This part-code is currently working fine:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Ancestors(Filter({[D_OrgArende].[D_OrgArende].MEMBERS},IN (SUBSTR([D_OrgArende].[D_OrgArende].CurrentMember.name,1,4), "SUB::SAS.IdentityGroups")).item(0)),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Ancestors(Filter({[D_OrgArende].[D_OrgArende].MEMBERS},IN (SUBSTR([D_OrgArende].[D_OrgArende].CurrentMember.name,1,4), "SUB::SAS.IdentityGroups")).item(1)),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Ancestors(Filter({[D_OrgArende].[D_OrgArende].MEMBERS},IN (SUBSTR([D_OrgArende].[D_OrgArende].CurrentMember.name,1,4), "SUB::SAS.IdentityGroups")).item(2)),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Ancestors(Filter({[D_OrgArende].[D_OrgArende].MEMBERS},IN (SUBSTR([D_OrgArende].[D_OrgArende].CurrentMember.name,1,4), "SUB::SAS.IdentityGroups")).item(3)),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Ancestors(Filter({[D_OrgArende].[D_OrgArende].MEMBERS},IN (SUBSTR([D_OrgArende].[D_OrgArende].CurrentMember.name,1,4), "SUB::SAS.IdentityGroups")).item(4))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;The problem is that I'm limited to the number of rows I put in the code. Is it possible somehow to get all Ancestors for a set of members? Now the code picks out a single group (member) at the time from the returned set of the filter function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;/Daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Mar 2013 15:21:47 GMT</pubDate>
    <dc:creator>DannyDizzy</dc:creator>
    <dc:date>2013-03-25T15:21:47Z</dc:date>
    <item>
      <title>MDX code for authorization in a cube</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/MDX-code-for-authorization-in-a-cube/m-p/87413#M1571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi!&lt;/P&gt;&lt;P&gt;I would like to add a authorization for people belonging to certain groups in a olap cube to be used for a wrs-report, one person can belong to multiple groups. This part-code is currently working fine:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Ancestors(Filter({[D_OrgArende].[D_OrgArende].MEMBERS},IN (SUBSTR([D_OrgArende].[D_OrgArende].CurrentMember.name,1,4), "SUB::SAS.IdentityGroups")).item(0)),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Ancestors(Filter({[D_OrgArende].[D_OrgArende].MEMBERS},IN (SUBSTR([D_OrgArende].[D_OrgArende].CurrentMember.name,1,4), "SUB::SAS.IdentityGroups")).item(1)),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Ancestors(Filter({[D_OrgArende].[D_OrgArende].MEMBERS},IN (SUBSTR([D_OrgArende].[D_OrgArende].CurrentMember.name,1,4), "SUB::SAS.IdentityGroups")).item(2)),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Ancestors(Filter({[D_OrgArende].[D_OrgArende].MEMBERS},IN (SUBSTR([D_OrgArende].[D_OrgArende].CurrentMember.name,1,4), "SUB::SAS.IdentityGroups")).item(3)),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Ancestors(Filter({[D_OrgArende].[D_OrgArende].MEMBERS},IN (SUBSTR([D_OrgArende].[D_OrgArende].CurrentMember.name,1,4), "SUB::SAS.IdentityGroups")).item(4))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;The problem is that I'm limited to the number of rows I put in the code. Is it possible somehow to get all Ancestors for a set of members? Now the code picks out a single group (member) at the time from the returned set of the filter function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;/Daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 15:21:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/MDX-code-for-authorization-in-a-cube/m-p/87413#M1571</guid>
      <dc:creator>DannyDizzy</dc:creator>
      <dc:date>2013-03-25T15:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: MDX code for authorization in a cube</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/MDX-code-for-authorization-in-a-cube/m-p/87414#M1572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have used descendants together with ascendants to achieve that.&lt;/P&gt;&lt;P&gt;I combined the two using &amp;lt;!--CONDITION--&amp;gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;generate(&lt;/P&gt;&lt;P&gt;Filter([DIM_Organisation].[DIM_Organisation].[koststal].members,IN ([DIM_Organisation].CurrentMember.name,"SUB::SAS.IdentityGroups"))&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;ascendants([DIM_Organisation].[DIM_Organisation].currentmember)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;!--CONDITION--&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;generate(&lt;/P&gt;&lt;P&gt;Filter([DIM_Organisation].[DIM_Organisation].[koststal].members,IN ([DIM_Organisation].CurrentMember.name,"SUB::SAS.IdentityGroups"))&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;descendants([DIM_Organisation].[DIM_Organisation].currentmember)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2013 14:00:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/MDX-code-for-authorization-in-a-cube/m-p/87414#M1572</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2013-04-03T14:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: MDX code for authorization in a cube</title>
      <link>https://communities.sas.com/t5/SAS-Web-Report-Studio/MDX-code-for-authorization-in-a-cube/m-p/87415#M1573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Fredrik! The generate function worked magic for me!&lt;/P&gt;&lt;P&gt; This was the result of my code:&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;/********************************************************&lt;/P&gt;&lt;P&gt;Lets you se all the members below a certain point of authurization.&lt;/P&gt;&lt;P&gt;*********************************************************/ &lt;/P&gt;&lt;P&gt;(Filter({[D_OrgArende].[D_OrgArende].MEMBERS},IN (SUBSTR([D_OrgArende].[D_OrgArende].Parent.Name,1,4),"SUB::SAS.IdentityGroups")))&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;/********************************************************&lt;/P&gt;&lt;P&gt;Lets you see all the members which leeds to the point of authorization (needed to be able to drill down/expand to the point of authorization)&lt;/P&gt;&lt;P&gt;*********************************************************/&lt;/P&gt;&lt;P&gt;generate(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Filter({[D_OrgArende].[D_OrgArende].MEMBERS}, IN (SUBSTR([D_OrgArende].[D_OrgArende].CurrentMember.name,1,4) , "SUB::SAS.IdentityGroups"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Ascendants( [D_OrgArende].[D_OrgArende].CurrentMember)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;/********************************************************&lt;/P&gt;&lt;P&gt;Lets you see the point which is connected to your id and the way leding to it.&lt;/P&gt;&lt;P&gt;*********************************************************/&lt;/P&gt;&lt;P&gt;generate(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Filter([D_OrgArende].[D_OrgArende].AllMembers,[D_OrgArende].[D_OrgArende].CurrentMember.Level.Name = 'KORTID' and [D_OrgArende].[D_OrgArende].CurrentMember.Name = 'SUB::SAS.PersonName')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Ascendants([D_OrgArende].[D_OrgArende].CurrentMember)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Apr 2013 11:38:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Web-Report-Studio/MDX-code-for-authorization-in-a-cube/m-p/87415#M1573</guid>
      <dc:creator>DannyDizzy</dc:creator>
      <dc:date>2013-04-04T11:38:30Z</dc:date>
    </item>
  </channel>
</rss>

