Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
dilip1234
Creator
Creator

How to filter data based on logged in user? [Qlik Sense + Geo analytic]

Hi All,

We are loading data in our Qlik app through load script. Please find the sample tables scripts for reference:

Geo Table Script

GeoTableScript.PNG

User Table Script

UserTableScript.PNG

User Permission Table Script

UserPermissionTableScript.PNG

STAR Schema as follows:

Geo Table [Geo.Id] ------------ User Permission Table [Geo.Id]------------User Permission Table [Users.Id]------------Users Table [Users.Id]


Sample data of above tables:

Data Shot.png

Now above script should run on some conditions like basis on logged in user access.


Let's say User1 is accessing my app, as we have User1 in User Data.

1. How to get logged in user details (username).

I have tried using OSUser() and QVUser() but that is giving me Person/Me.


I am expecting 'User1'.


2. Once I got this logged in user details, I am trying to apply below condition in my script:


SET vLoggedInUserEnterpriseId = $(QVUser); //assuming that it will give User1, looking for solution

Now in user script I am planning to change query like:

UserDataSCript.PNG

So that above condition is returning me only those Geos which are accessible to User1.

If I am implementing this scenario then it will not give exact solution, how to load data for each user if we place such conditions in script.

Anyone know what is the best approach to achieve such a scenario? Any other way through which i can get logged in user related data.

Is there any way where do not need to pass above condition in script and we can achieve our result.

Thanks

Dilip Solanki

Thanks
Dilip Solanki
1 Reply
kaanerisen
Creator III
Creator III

Hi Dilip,

You can use "section access" to make it work.

Managing security with section access ‒ Qlik Sense

Hope it helps..