Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
syedmazhar
Contributor II
Contributor II

Qlik Sense Section Access row level security

I am using the below code for implementing section access on qlik sense and i am getting an error but when i remove the section access(comment section access) and checked the access for the user then its showing the access correctly.

Section Access Code:

Bridge_Table:

load
Distinct upper([STATE]&'|'&[COUNTRYNAME]) as Data_Key,
upper(([STATE])&'|ALL') AS SECTION_ACCESS_KEY
resident MainTable;
load
Distinct upper([STATE]&'|'&[COUNTRYNAME]) as Data_Key,
upper('ALL|'&([COUNTRYNAME])) AS SECTION_ACCESS_KEY
resident MainTable;

load
Distinct upper([STATE]&'|'&[COUNTRYNAME]) as Data_Key,
upper('ALL|ALL') AS SECTION_ACCESS_KEY
resident MainTable;

BridgeTbl_Temp:
LOAD Data_Key , SECTION_ACCESS_KEY, 'BridgeTbl' AS TableName
Resident Bridge_Table;

DROP table Bridge_Table;
RENAME table BridgeTbl_Temp to BridgeTbl;

LET vQlikReloadUser = TRIM(REPLACE(REPLACE(UPPER(OSUSER()),'DOS\',''),'DS\',''));
LET vQlikReloadUserGroup = TRIM(REPLACE(REPLACE(UPPER(OSUSER()),'DOS\',''),'DS\',''));

[SecuritList]:
LOAD DISTINCT UPPER('ADMIN') AS [ACCESS]
, UPPER('$(vQlikReloadUser)') AS [USERID]
,UPPER('$(vQlikReloadUserGroup)') AS GROUP
, SECTION_ACCESS_KEY
, 'ADMIN' AS SA_ACCESS
Resident BridgeTbl;

Concatenate(SecuritList)
[Section Acces Raw]:
LOAD UPPER(TRIM(ACCESS)) AS ACCESS,
REPLACE(UPPER(TRIM(USERID)),'DIR\','') AS USERID,
REPLACE(UPPER(TRIM(GROUP)),'DIR\','') AS GROUP,
UPPER(IF(TRIM(STATE)='*','ALL',TRIM(STATE))&'|'& IF(TRIM(COUNTRYNAME)='*','ALL',TRIM(COUNTRYNAME))) AS SECTION_ACCESS_KEY,
'Section Access' AS Source
FROM [lib://Data/Users_Access_List.xlsx]
(ooxml, embedded labels, table is [Security Cut New]);

section access;

access:
load ACCESS,
USERID,
GROUP,
SECTION_ACCESS_KEY
resident SecuritList;

section application;

Drop Table SecuritList;

**************************************

Key From Main Table

upper([state]&'|'&[country]) as Data_Key

 

Error:

syedmazhar_0-1633452957821.png

 

Excel Source:

syedmazhar_1-1633453217906.png

 

Please help me to resolve this issue and kindly let me know if i can achieve the above requirement using other ways.

 

Thanks in Advance.

 

Regards,

Mazhar 

 

1 Reply
micheledenardi
Specialist II
Specialist II

Is your Qlik Sense environment connected to your domain (via UDC) ?In that case you have to include the domain name (DIR\ or DOS\) in USER field