3 Replies Latest reply: Jul 17, 2018 6:52 AM by Mindaugas Bacius RSS

    Get user name

    reshma k m

      Hi,

       

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

        • Re: Get user name
          Nate Hallquist

          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

          • Re: Get user name
            Bala Bhaskar

            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.

            • Re: Get user name
              Mindaugas Bacius

              Nate Hallquist is 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.