Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Jothi
Contributor III
Contributor III

Section Access - Access was denied after reload

When the same data, when loaded from excel sheet or loaded inline, works, but when the data is selected and loaded from SQL table, it throws the below error -

Access was denied after reload. Check that the user that reloads the script is included in the section access part of the script.

Working code- 

Section Access;
Authorization:

LOAD
"ACCESS",
"USERID",
BUSINESSUNITID
FROM [lib://AttachedFiles/Qlik.xlsx]
(ooxml, embedded labels, table is Sheet1);

Code that fails -

Section Access;
Authorization:

LOAD "ACCESS",
"USERID",
BUSINESSUNITID;

SELECT ACCESS,
USERID,
BUSINESSUNITID
FROM Dashboard.QlikSectionAccess;

The data shown below, which is the result of the SQL View Dashboard.QlikSectionAccess is inserted from excel and it loads, while loading from SQL table fails.

Section access data -

ACCESS USERID BUSINESSUNITID
ADMIN INTERNAL\SA_SCHEDULER *
ADMIN      SAML\u1111 *
USER       SAML\u1222 2704
USER       SAML\u1222 2705
USER       SAML\u1444 2706
USER       SAML\u1444 2707
Labels (2)
1 Solution

Accepted Solutions
Jothi
Contributor III
Contributor III
Author

The solution to this issue was to use the Upper() on the USERID.

 

LOAD UPPER(ACCESS) as ACCESS,
UPPER(USERID) as USERID,
BUSINESSUNITID;

View solution in original post

3 Replies
Chanty4u
MVP
MVP

May be missing below statement

Section Access;
Authorization:

LOAD "ACCESS",
"USERID",
BUSINESSUNITID;

SQL SELECT ACCESS,
USERID,
BUSINESSUNITID
FROM Dashboard.QlikSectionAccess;

Section Application;

 

watch sample video in below link for loading SA data from DB.

https://community.qlik.com/t5/New-to-Qlik-Sense/Section-access-with-DataBase/td-p/1067573

 

Jothi
Contributor III
Contributor III
Author

The solution to this issue was to use the Upper() on the USERID.

 

LOAD UPPER(ACCESS) as ACCESS,
UPPER(USERID) as USERID,
BUSINESSUNITID;

1994
Contributor
Contributor

AUTHORIZARTION:
LOAD
'ADMIN' AS "ACCESS",
 //   UPPER(USER_DOMAIN)&'\'&
 UPPER(USER_CODE) AS "USERID",
   UPPER(LOGIN_USER_CODE) as LOGIN_USER_CODE,
   // USER_CODE,
    COMP_CODE as USER_COMP_CODE,
    CAT_CODE,
    CAT_PARENT_CODE,
    CAT_ITEM_FLAG,
   [FN_GET_CAT_RIGHTS(CAT_CODE,USER_CODE,UGB_COMP_CODE)],
    SCHEMA AS ENTITY
FROM [lib://Retail QVD (qlik-bi_qsadmin)/ErpsysretQVD/Master\ACCESSDATA1.qvd]
(qvd);
//WHERE USER_MODULE='Sales';
 
LOAD * INLINE
[
 ACCESS,USERID,USER_COMP_CODE,USER_DIVN_CODE,ENTITY
'ADMIN','INTERNAL\SA_SCHEDULER','ALL','ALL','ALL'
 
];
 
SECTION ACCESS;
LOAD
"ACCESS",
    "USERID",
    IF(UPPER(TRIM([USER_COMP_CODE]))= 'ALL','*', TEXT([USER_COMP_CODE])) AS [COMPANY ID],
    IF(UPPER(TRIM([CAT_CODE]))= 'ALL','*', TEXT([CAT_CODE])) AS [CAT_CODE],
    IF(UPPER(TRIM([CAT_PARENT_CODE]))= 'ALL','*', TEXT([CAT_PARENT_CODE])) AS [CAT_PARENT_CODE],
     IF(UPPER(TRIM([CAT_ITEM_FLAG]))= 'ALL','*', TEXT([CAT_ITEM_FLAG])) AS [CAT_ITEM_FLAG],
    IF(UPPER(TRIM([ENTITY]))= 'ALL','*', TEXT([ENTITY])) AS [ENTITY]
RESIDENT AUTHORIZARTION;
SECTION APPLICATION;
DROP TABLE AUTHORIZARTION;                                                                                                                            
getting error like 
Access was denied after reload. Check that the user that reloads the script is included in the section access part of the script.
 
Data has not been loaded. Please correct the error and try loading again.