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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
83kg
Contributor II
Contributor II

show object only for some users

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!

Labels (1)
2 Solutions

Accepted Solutions
WeLoveQlik
Partner - Creator
Partner - Creator

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.

 

 

IPC Global: ipc-global.com

View solution in original post

83kg
Contributor II
Contributor II
Author

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 😉

View solution in original post

4 Replies
WeLoveQlik
Partner - Creator
Partner - Creator

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.

 

 

IPC Global: ipc-global.com
83kg
Contributor II
Contributor II
Author

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 ...

WeLoveQlik
Partner - Creator
Partner - Creator

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

IPC Global: ipc-global.com
83kg
Contributor II
Contributor II
Author

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 😉