Qlik Community

Qlik Sense Data Connectivity

Discussion board where members can learn more about Qlik Sense Data Connectivity.

dilip_solanki
Contributor

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
Contributor III

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

Hi Dilip,

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

Managing security with section access ‒ Qlik Sense

Hope it helps..

Community Browser