We are loading data in our Qlik app through load script. Please find the sample tables scripts for reference:
Geo Table Script
User Table Script
User Permission Table Script
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:
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:
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.