Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Harsha2
Contributor
Contributor

sheet level access through QMC

hi 

can anyone help me to implement sheet level access through QMC. I didn't find any exact community link for this.

I have 4 sheets in my dashboard and they should be visible to particular users only. Example sheet1 should be visible to 
USER1, Sheet 2 should be visible to User2 and so on..


Thanks in advance

Labels (3)
1 Reply
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

HI @Harsha2 

What you will want to be doing is creating an expression which shows or hides sheets based on a variable.

I tend to set up a variable called vHasAccess or similar and then have that as the Show Condition on sheets that are not available to all.

The variable would then have something like:

=if(index(lower(OsUser()), 'steved')) + index(lower(OsUser()), 'jdoe')) > 0, 1, 0)

That would work for a very simple setup where you have a couple of admins that can see system sheets.

For more complex scenarios you could load the list of users who have access to each sheet and have something like the following in the vHasAccess variable:

count({1<%SheetUser={'$(=upper(subfield(OsUser(), '=', 3)))'},%SheetName={'$(=upper('$1'))'}>}%SheetUser)>0

In this case a table is loaded with %SheetUser and %SheetName as columns, the user is the AD user name that you want to give access and sheet is just a name you give to each sheet you want to make show hide.

The $1 is a parameter that is passed into the variable with a sheet name.

On each sheet you would have a show condition something like this:

=$(=$(vHasAccess(Dev)))

This would then show the sheet if the currently logged in user has access in the lookup table to the Dev set of sheets.

Hope that makes some kind of sense?

Steve