Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

reshma_km
Contributor III

Get user name

Hi,

I was able to get User Directory and user id using osuser() function in Qliksense. Can I get the user name as well?

3 Replies
hallquist_nate
Contributor III

Re: Get user name

Here is what I know about this type of data.

The function OSUser() only fetches the userID of the person that is actually accessing the app.  If you want to translate that into an actual user name, you would need to get that info from your Active Directory, or other User Directory.  Even then, I'm not 100% sure how you get the actual user name.  You would need to create some expression that calculates the user name based on the UserID.

Can you give us some information on what the requirements are for this?  Do you need to create a list of usernames?  Are you just "welcoming" that user by displaying a message like, "Welcome user T569382", and want to be "Welcome John Wick"?

Also, do you have access to the proper directory to fetch the User Name associated with a UserID?

More info would be helpful.

Nate

balabhaskarqlik
Honored Contributor

Re: Get user name

QvUser() returns you the user by which you have open the QlikView application.

This function is used when you have applied the section access in your application.

MindaugasBacius
Valued Contributor II

Re: Get user name

hallquist_nateis right about joining Active Directory.


I use this script to link me to the Users:


SET RootDse1 = 'OU=Company,DC=company,DC=lt';

OLEDB CONNECT32 TO ...;

ADUsers:

LOAD Distinct name

    ,title

    ,Upper(sAMAccountName) as User

;

SQL select

name,

title,

sAMAccountName

FROM 'LDAP://$(RootDse1)'  WHERE objectCategory='person';


I do remember that I asked my IT department some help about Active Directory.

Community Browser