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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sifatnabil
Specialist
Specialist

osuser() to hide sheet not working

Hi all,

I have a sheet that I want to hide to specific users bases on OSuser().

I used this in the conditional show:

=if(match(osuser(),

'GLOBAL\A',

'GLOBAL\B',

'GLOBAL\C',

'GLOBAL\D',

'GLOBAL\E')=0,0)

Meaning that if the user doesn't match A, B, C, D, or E, the sheet will be hidden. However, user C cannot see the sheet, whereas user D can. Why would this happen? Thanks.

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

Check the ID that is displayed in the AccessPoint page (top right corner) for user D. Does it match GLOBAL\D?

Also two suggestions:

  • Security-wise it's always better to expressly permit someone to see the sheet instead of revoking rights from listed users. The default security should be "DENY".
  • Always add an "otherwise" value to your condition, as the default NULL value may prove very unreliable. Your conditional show then becomes:

=if(match(osuser(),

'GLOBAL\A',

'GLOBAL\B',

'GLOBAL\C',

'GLOBAL\D',

'GLOBAL\E')=0, 0, 1)

View solution in original post

4 Replies
Anonymous
Not applicable

I presume you have given sample users above.

For your real if() with the real users I would double check for any typo's.

sifatnabil
Specialist
Specialist
Author

I've checked for typos - the expression works locally between my server account and normal account. e.g. if I my server account is D, and I open the doc on my server account, I can view the sheet. The same if opened on my normal account, hides the sheet. So I'm expecting it to work on the server but it's not.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Check the ID that is displayed in the AccessPoint page (top right corner) for user D. Does it match GLOBAL\D?

Also two suggestions:

  • Security-wise it's always better to expressly permit someone to see the sheet instead of revoking rights from listed users. The default security should be "DENY".
  • Always add an "otherwise" value to your condition, as the default NULL value may prove very unreliable. Your conditional show then becomes:

=if(match(osuser(),

'GLOBAL\A',

'GLOBAL\B',

'GLOBAL\C',

'GLOBAL\D',

'GLOBAL\E')=0, 0, 1)

sifatnabil
Specialist
Specialist
Author

Checked the right corner, it seems capitalization matters. I was doing GLOBAL\user_a when the user was appearing as GLOBAL\User_A