Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a Qlik sense application with some objects - straight table is one of them.
Let say that 20 users have access to the app, but I want to make straight table visible only for 3 of them.
What's the best way how to do it?
Thanks for your ideas!
Hello,
I solve this problem by creating a table in the script of the users who can see the "privileged" objects and concatenate the list together.
Example:
PrivledgedUsers:
LOAD * INLINE [
PrivledgedUsersIDs
QlikUser1
QlikUser2
QlikUser3
];
PrivledgedUsers:
NoConcatenate
LOAD CONCAT(UPPER(PrivledgedUsersIDs),'|') as PrivledgedUsersIDs
Resident PrivledgedUsers;
Drop table PrivledgedUsers;
Next, I create a Variable I call vOSUser. Definition of variable below.
=SUBFIELD(OSUSER(),'UserId=',2)
I then use the show condition option to hide the Sheet / Object / Column with the expression below.
=IF(WILDMATCH(PrivledgedUsersIDs,'*$(vOSUser)*'),1,0)
What happens is, Qlik checks the User logged in against the concatenated list of privledged users and determines if they are able to view that Sheet / Object / Column.
I work in cloud. I was able to download user information via REST connector.
1. vOSuser = SUBFIELD(OSUSER(),'UserId=',2) retains information which matches with 'subject' field from REST conection.
2. PrivledgedUsersIDs in this case should contain the same values like 'subject' field in REST connection.
taking into consideration these 2 points your solution works.
thank you for pinging me forward with this, with your help I consider it as resolved 😉
Hello,
I solve this problem by creating a table in the script of the users who can see the "privileged" objects and concatenate the list together.
Example:
PrivledgedUsers:
LOAD * INLINE [
PrivledgedUsersIDs
QlikUser1
QlikUser2
QlikUser3
];
PrivledgedUsers:
NoConcatenate
LOAD CONCAT(UPPER(PrivledgedUsersIDs),'|') as PrivledgedUsersIDs
Resident PrivledgedUsers;
Drop table PrivledgedUsers;
Next, I create a Variable I call vOSUser. Definition of variable below.
=SUBFIELD(OSUSER(),'UserId=',2)
I then use the show condition option to hide the Sheet / Object / Column with the expression below.
=IF(WILDMATCH(PrivledgedUsersIDs,'*$(vOSUser)*'),1,0)
What happens is, Qlik checks the User logged in against the concatenated list of privledged users and determines if they are able to view that Sheet / Object / Column.
Thank you for your reply! 🙂
The problem is that OSUSER() in my case doesn't provide information about identification of user as it looks like this:
UserDirectory=; UserId=kLqiQo8vfNoHYBB0Lv-7Y8XAYNtP34-BFsB9GG-CCIw
Based on this I cannot identify users to match with INLINE table ...
Are you on prem or Cloud?
On Prem, if you have access to the qlik monitoring apps you can use the LIB CONNECT TO 'monitor_apps_REST_user'; to get that information.
You can use the Qlik APIs to pull this information in the cloud.
https://yourtenant.us.qlikcloud.com/api/v1/users
I work in cloud. I was able to download user information via REST connector.
1. vOSuser = SUBFIELD(OSUSER(),'UserId=',2) retains information which matches with 'subject' field from REST conection.
2. PrivledgedUsersIDs in this case should contain the same values like 'subject' field in REST connection.
taking into consideration these 2 points your solution works.
thank you for pinging me forward with this, with your help I consider it as resolved 😉