Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
sharu055
Creator
Creator

Qliksense Section Access Script

I am migrating my qlikview app to qliksense, in qlikview we use the below script for section access to provide access to users. If i use the same script in qliksense its not working. Please help in writing qliksense script for section access. Thanks in advance.

Qlikview Script: 

Section Access;

LOAD Upper(ACCESS) as ACCESS,
NTNAME ,
Upper(PERMISSION) as PERMISSION1

FROM [../Section Access.xlsx]

(ooxml, embedded labels, table is Section_Access);

Section Application;

Data example:

ACCESS NTNAME PERMISSION
ADMIN Red *
ADMIN Orange *
User Green Green
User Green White
User Green Black
User Black Black
5 Replies
Chanty4u
MVP
MVP

Code looks ok but you have to change your from path in qliksense it's quite different than qlikview 

Section Access;

LOAD 

    UPPER(ACCESS) as ACCESS,

    NTNAME,

    UPPER(PERMISSION) as PERMISSION1

FROM [lib://YourDataConnection/Section Access.xlsx]

(ooxml, embedded labels, table is Section_Access);

 

Section Application;

sharu055
Creator
Creator
Author

Yes, I used the proper path for qliksense to fetch the data, after refresh i am getting the below popup. I am into Admin and permission is *. Not sure why i am getting below popup, Its in Dev not moved to UAT. 

 

sharu055_0-1740047255059.png

 

simsa
Contributor III
Contributor III

In a text and Image viz- just type out osuser() and check your userid- 
For instance, if directory is XYZ and user id is ABC- then username will be XYZ\ABC

I hope the format that you have provided is correct

Ravi1212
Contributor II
Contributor II


Hello @sharu055 ,
You can refer below script and considerations ==>
 
Qlik Sense Section Access Script (Equivalent to QlikView Logic)
Section Access Implementation

Section Access;

// Load the security table (Qlik Sense is case-sensitive)
LOAD
Upper(ACCESS) as ACCESS, // Should be either "ADMIN" or "USER"
Upper(NTNAME) as USERID, // Must align exactly with the Qlik Sense login (case-sensitive)
Upper(PERMISSION) as PERMISSIONS // The field name should be "PERMISSIONS" (not singular)
FROM [lib://YourFolder/Section_Access.xlsx]
(ooxml, embedded labels, table is Section_Access);

Section Application;

// Your main data model starts here...


== Key Differences Between QlikView & Qlik Sense ==

Field Naming Conventions:
Instead of NTNAME, Qlik Sense expects USERID, which should precisely match the user’s login (e.g., DOMAIN\Ravi or an email address).
The field PERMISSIONS must be used instead of PERMISSION1 (note the plural form).
Case Sensitivity Considerations:
User logins in Qlik Sense are case-sensitive.
To prevent mismatches, use Upper() to standardize usernames if they are stored in uppercase.

Permission Formatting:
If a user has access to multiple permissions, separate them using semicolons (;).

ACCESS USERID PERMISSIONS
ADMIN DOMAIN\Red *
ADMIN DOMAIN\Orange *
USER DOMAIN\Green Green;White;Black
USER DOMAIN\Black Black


Essential Qlik Sense Considerations :

User Authentication:
Ensure that users log into Qlik Sense through an identity provider (e.g., Active Directory, OIDC) that corresponds to the format used in USERID.

Restricting Sheet Access:
After reloading, control sheet-level access by right-clicking the sheet > Properties > Security settings.

Data Reduction:
If you need to limit access to specific rows in the dataset, add an OMIT field in the Section Access table.

Troubleshooting & Common Issues ==>
"No Data Available" Error: Ensure that USERID exactly matches the logged-in user’s identity. You can confirm this by checking =OSUser() in a text object. 

Permission Issues: Use * for admin users to grant unrestricted access.

Reloading Issues: Always test the script with a user who has both Section Access rights and proper QMC security permissions.

ali_hijazi
Partner - Master II
Partner - Master II

In QlikSense the NTNAME is replaced by USERID
so you need at least two columns in the section access:
ACCESS: which takes either ADMIN or USER
USERID: in the form of DOMAIN\USERNAME

I can walk on water when it freezes