Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

OSUser Conditional Show

Hi All,

I have a dashboard with some elements that I want to show or hide based on the user of the PC it is being viewed on.  I've got a separate 'security' table set up with a list of usernames, then a 1 or 0 for access or no access.

The conditional show statement I use is something like:

=If(Only({<username={$(=osuser)}>} permission)=1,1,0)

username is the username field name and permission is the field that is linked to the sheet/object I want to show or hide. If the username of the person logged in to the PC is found in the security table and the permission field contains a 1, then it is shown, otherwise it is not.

This works for all usernames except for those that contain hyphens - all objects are displayed for these users.

Can anyone shed any light?

Thanks in advance

1 Solution

Accepted Solutions
krishna_2644
Specialist III
Specialist III

Did you try enclosing the $(=osuser) in double quotes?

Usually it should be enclosed in double quotes so as to avoid the problems caused by special characters and spaces.

Thanks

View solution in original post

3 Replies
krishna_2644
Specialist III
Specialist III

Did you try enclosing the $(=osuser) in double quotes?

Usually it should be enclosed in double quotes so as to avoid the problems caused by special characters and spaces.

Thanks

maxgro
MVP
MVP

osuser()

Not applicable
Author

Resolved:

As per maxgro's response, it should've been osuser() in the original post (typo).

The solution was to put single quotes around the $(=osuser()) in the set analysis.  I think the hyphen was being treated as an operand rather than text, the quotes forced it to be considered as text.

Thanks!