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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Section Access and a variable

In am using section access for user logins. I want to put into a variable the "userid" of the person who logged in. I can't seem to get it to work. How can I do this?

Thanks,

Stephen

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

It's a function:
=QVUser()

View solution in original post

6 Replies
Anonymous
Not applicable
Author

It's a function:
=QVUser()

Not applicable
Author

Thanks. That did what I needed.

Not applicable
Author

Now I am having trouble changing the condition on a sheet. What I want to do is set the condition to 1=2 (hide) or 1=1(show) depending on who is login to the document. I have the user name OK but am having trouble setting the condition. Need help.

Thanks,

Stephen

Anonymous
Not applicable
Author

Stephen,
The condion could be:
QVUser() =STEPHEN
Or something like this.

Not applicable
Author

Sorry I should have given more detail. I have many users that log in and I have to run the user through a macro when the document is opened that will have an if or select case routine to determine whether or not to show the sheet to the user.

Anonymous
Not applicable
Author

Well, I'm pretty much sure you can do it without a macro. For example, use dynamic data reduction, if you're not using it already. Example:
Add a field, say "SHOW" in section access and in section application, probably as data island. Use the conditions in section access to assgn value 'YES' (or 1, if you prefer) for users who will have access to the restricted objects, and 'NO' ( or 0) for all other users. Now your show condition will be:
SHOW = 'YES' (if you use YES/NO)
or simply
only(SHOW) (if you use 1/0)
Note: there is no need for 1=2 and 1=1. Simply 0 in condition will hide an object, and 1 will show it.