<?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 Re: Section access with two reductions in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502584#M103474</link>
    <description>&lt;P&gt;Can you combine USERPROFILE &amp;amp; ROLE into a single field, and use that for the access restriction?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ben_P_0-1737620441734.png" style="width: 179px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/176797iB4AEDE44BA013AF4/image-dimensions/179x136?v=v2" width="179" height="136" role="button" title="Ben_P_0-1737620441734.png" alt="Ben_P_0-1737620441734.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jan 2025 08:20:56 GMT</pubDate>
    <dc:creator>Ben_P</dc:creator>
    <dc:date>2025-01-23T08:20:56Z</dc:date>
    <item>
      <title>Section access with two reductions</title>
      <link>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502484#M103463</link>
      <description>&lt;P&gt;Hello everyone&lt;/P&gt;
&lt;P&gt;Hope everyone find well&lt;/P&gt;
&lt;P&gt;I am facing with an issue regarding the section access topic.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. I find all the M-cold name in the active directory&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;LI-CODE lang="python"&gt;// Cargar la jerarquía de managers desde la fuente principal
LOAD 
    UPPER(manager_email) AS m_email,
    worker_id;

[hcm_hierarchy]:
SELECT *
FROM Aws"hr"."hierarchy";

// Conectar al origen LDAP
LIB CONNECT TO 'LDAP';

// Cargar datos del Active Directory directamente sin usar bucles ni variables
ActiveDirectory: 
LOAD 
    UPPER(mail) AS m_email,
    'M-COLD\' &amp;amp; UPPER(sAMAccountName) AS USR;
SQL SELECT
    mail,
    sAMAccountName
FROM 'LDAP/INTERNAL';

// Unión izquierda entre la jerarquía de managers y la tabla de Active Directory
LEFT JOIN (hcm_hierarchy)
LOAD
    UPPER(m_email) AS m_email,
    UPPER(USR) AS USERID
RESIDENT ActiveDirectory;

// Crear tabla temporal con los datos combinados
HIERARCHY_AD:
NoConcatenate LOAD
    m_email,
    worker_id,
    USERID
RESIDENT hcm_hierarchy;

// Eliminar tablas intermedias
DROP TABLE hcm_hierarchy;
DROP TABLE ActiveDirectory;

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Secondly, I am building the section access&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;USERS:
LOAD * Inline [
ACCESS,USERID,REDUCTION
ADMIN,INTERNAL\SA_SCHEDULER,*
ADMIN,M-COLD\QSSERVICE,*
];


// Load the access list from the Excel file (specific to HR)
ACCESS_LIST:
LOAD
    UPPER(ACCESS) as ACCESS,
    UPPER(NTNAME) AS USERID
FROM [lib://FILES.01.SOURCE/Visibility/Visibility_HR_Workforce.xlsx]
(ooxml, embedded labels);

// Load hierarchy information (from Active Directory or another source)
HIERARCHY_AD1:
LOAD
    UPPER(USERID) as USERID,
    worker_id as REDUCTION
RESIDENT HIERARCHY_AD; // Ajusta según tu fuente de datos

// Join the access list with the hierarchy data to associate users with their REDUCTION
INNER JOIN (ACCESS_LIST)
LOAD
    USERID,
    REDUCTION
RESIDENT HIERARCHY_AD1;

// Limpia la tabla temporal de jerarquías
DROP TABLE HIERARCHY_AD1;

// Combinar la lista de usuarios con la lógica de ADMIN
CONCATENATE (USERS)
LOAD
    ACCESS,
    USERID,
    IF(ACCESS='ADMIN', '*', REDUCTION) as REDUCTION
RESIDENT ACCESS_LIST;

// Limpia la tabla de lista de acceso
//DROP TABLE ACCESS_LIST;

// Section Access: Carga la tabla final en la sección de acceso
SECTION ACCESS;
LOAD
    ACCESS,
    USERID,
    REDUCTION
RESIDENT USERS;

// Limpia la tabla temporal de usuarios
DROP TABLE USERS;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I have this structure on the file, so I have to adjust this script with this information.&lt;BR /&gt;Once I set the General Manager, it has to see only the people behind, ignoring the user profile, onces Role does not has anything, pay attention on the user profile.&lt;/P&gt;
&lt;TABLE width="466"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="90.3472px"&gt;ACCESS&lt;/TD&gt;
&lt;TD width="134.514px"&gt;NTNAME&lt;/TD&gt;
&lt;TD width="124.514px"&gt;USERPROFILE&lt;/TD&gt;
&lt;TD width="115.503px"&gt;ROLE&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="90.3472px" style="font-weight: 400;"&gt;ADMIN&lt;/TD&gt;
&lt;TD width="134.514px" style="font-weight: 400;"&gt;USER1&lt;/TD&gt;
&lt;TD width="124.514px" style="font-weight: 400;"&gt;*&lt;/TD&gt;
&lt;TD width="115.503px" style="font-weight: 400;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="90.3472px" style="font-weight: 400;"&gt;USER&lt;/TD&gt;
&lt;TD width="134.514px" style="font-weight: 400;"&gt;USER2&lt;/TD&gt;
&lt;TD width="124.514px" style="font-weight: 400;"&gt;EE01&lt;/TD&gt;
&lt;TD width="115.503px" style="font-weight: 400;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="90.3472px" style="font-weight: 400;"&gt;ADMIN&lt;/TD&gt;
&lt;TD width="134.514px" style="font-weight: 400;"&gt;USER3&lt;/TD&gt;
&lt;TD width="124.514px" style="font-weight: 400;"&gt;*&lt;/TD&gt;
&lt;TD width="115.503px" style="font-weight: 400;"&gt;GENERAL MANAGER&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="90.3472px" style="font-weight: 400;"&gt;ADMIN&lt;/TD&gt;
&lt;TD width="134.514px" style="font-weight: 400;"&gt;USER4&lt;/TD&gt;
&lt;TD width="124.514px" style="font-weight: 400;"&gt;*&lt;/TD&gt;
&lt;TD width="115.503px" style="font-weight: 400;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Jan 2025 17:12:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502484#M103463</guid>
      <dc:creator>migueldfr_23</dc:creator>
      <dc:date>2025-01-22T17:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Section access with two reductions</title>
      <link>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502584#M103474</link>
      <description>&lt;P&gt;Can you combine USERPROFILE &amp;amp; ROLE into a single field, and use that for the access restriction?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ben_P_0-1737620441734.png" style="width: 179px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/176797iB4AEDE44BA013AF4/image-dimensions/179x136?v=v2" width="179" height="136" role="button" title="Ben_P_0-1737620441734.png" alt="Ben_P_0-1737620441734.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 08:20:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502584#M103474</guid>
      <dc:creator>Ben_P</dc:creator>
      <dc:date>2025-01-23T08:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Section access with two reductions</title>
      <link>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502671#M103489</link>
      <description>&lt;P&gt;Thanks for answering.&lt;BR /&gt;I change the second logic to make it easier and redeable.&lt;/P&gt;
&lt;P&gt;Even though, it does not work, I guess I am approaching to the goald.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;USERS:
LOAD * Inline [
ACCESS,USERID,REDUCTION, ROLE
ADMIN,INTERNAL\SA_SCHEDULER,*,
ADMIN,M-COLD\QSSERVICE,*,
ADMIN,M-COLD\C-ALBERTM,*,
ADMIN,M-COLD\C-MIOTTOA,*,
ADMIN,M-COLD\C-ASTOLFA,*,
];

// Load Access List from Excel
ACCESS_LIST:
LOAD
    UPPER(ACCESS) AS ACCESS,
    UPPER(NTNAME) AS USERID,
    UPPER(USERPROFILE) AS REDUCTION,
    UPPER(ROLE) AS ROLE
FROM [Visibility_HR_Workforce.xlsx]
(ooxml, embedded labels, table is Sheet1);


Left Join (USERS)
LOAD
    USERID,
    worker_id as REDUCTION_by_ID
Resident HIERARCHY_AD;

Drop Table HIERARCHY_AD;

SECTION ACCESS;
LOAD
    ACCESS,
    USERID,
    IF(ROLE = 'GM', REDUCTION_by_ID, REDUCTION) AS REDUCTION
Resident USERS;&lt;/LI-CODE&gt;
&lt;P&gt;As you said before, I get the result of that table with only three columns.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does it make sense ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 14:27:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502671#M103489</guid>
      <dc:creator>migueldfr_23</dc:creator>
      <dc:date>2025-01-23T14:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Section access with two reductions</title>
      <link>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502673#M103490</link>
      <description>&lt;P&gt;This might be of use:&amp;nbsp;&lt;A href="https://community.qlik.com/t5/Design/Data-Reduction-Using-Multiple-Fields/ba-p/1474917" target="_blank"&gt;Data Reduction Using Multiple Fields - Qlik Community - 1474917&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 14:58:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502673#M103490</guid>
      <dc:creator>Ben_P</dc:creator>
      <dc:date>2025-01-23T14:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Section access with two reductions</title>
      <link>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502676#M103491</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/t5/Design/Authorization-using-a-Hierarchy/ba-p/1476319" target="_blank" rel="noopener"&gt;Thttps://community.qlik.com/t5/Design/Authorization-using-a-Hierarchy/ba-p/1476319#comments&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will be the one, trying to understand and replicate in my case ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jan 2025 15:16:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502676#M103491</guid>
      <dc:creator>migueldfr_23</dc:creator>
      <dc:date>2025-01-23T15:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Section access with two reductions</title>
      <link>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502808#M103505</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Would you know how to set "view as" as is in Power BI? In order to check how would see that specific user&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 08:50:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502808#M103505</guid>
      <dc:creator>migueldfr_23</dc:creator>
      <dc:date>2025-01-24T08:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Section access with two reductions</title>
      <link>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502812#M103506</link>
      <description>&lt;P&gt;The way I do this is to just remove the 'section access' line in the script, so that you load the access permissions table as a normal table. Then you can just filter for a specific user in this table to see how they'd see the app.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2025 09:04:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Section-access-with-two-reductions/m-p/2502812#M103506</guid>
      <dc:creator>Ben_P</dc:creator>
      <dc:date>2025-01-24T09:04:03Z</dc:date>
    </item>
  </channel>
</rss>

