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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
MigueldelCampo
Contributor III
Contributor III

UserID as Name in INLINE matrix

Hi, in the company we use Active Directory, so users appear as UserID. What is an efficient way to display something like 'Hello Miguel', for example, on a dashboard sheet? I used INLINE but I can't find the function that retrieves the values from the Name column and associates it with the UserID of the logged-in session. Can you help me? Thanks in advance.

Labels (4)
1 Solution

Accepted Solutions
PsychoJohn
Contributor
Contributor

Hi Miguel,

drop this in your load scripts as "User Table":

LET vUser = right(OSUser(),10); // edit this to match your AD structure
 
LIB CONNECT TO 'monitor_apps_REST_user_condensed';  
 
User:
   Load
   userDirectory & '\' & userId AS UserId,
   [name] AS [User Name],
   userDirectory as [User Directory]
   Where userId=$(vUser)
   ;
   SQL SELECT 
      "userId",
      "userDirectory",
      "name"
   FROM JSON (wrap on) "root"
   ;

then add this: 'Welcome User: '&' '&[User Name]

or this: 'Welcome User: '&' '&SubField([User Name],',',-1)

to the sheet.

Cheers!

View solution in original post

3 Replies
Or
MVP
MVP

OSUser() is typically the easiest one on the front end. It'll typically return the domain as well, so you may need to use something like Mid(OSUser(),6,9999) for example if your domain is five characters long. 

PsychoJohn
Contributor
Contributor

Hi Miguel,

drop this in your load scripts as "User Table":

LET vUser = right(OSUser(),10); // edit this to match your AD structure
 
LIB CONNECT TO 'monitor_apps_REST_user_condensed';  
 
User:
   Load
   userDirectory & '\' & userId AS UserId,
   [name] AS [User Name],
   userDirectory as [User Directory]
   Where userId=$(vUser)
   ;
   SQL SELECT 
      "userId",
      "userDirectory",
      "name"
   FROM JSON (wrap on) "root"
   ;

then add this: 'Welcome User: '&' '&[User Name]

or this: 'Welcome User: '&' '&SubField([User Name],',',-1)

to the sheet.

Cheers!

anat
Master
Master

'Hello '&Capitalize(SubField(OSUser(), '=', -1))