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

OSUser() and QVUser()

I have an application which was using QVUser() USERID and PASSWORD for application security. I would then have a text box with the name of the Application as follows:

Screen Shot 2015-12-16 at 20.28.15.pngScreen Shot 2015-12-16 at 20.32.38.png

The expression in the text box is:

  =If(QVUser() = 'CHITEMERERE CHRIS', 'Advanced Pharmaceutical Business Intelligence & Analytics Suite', 'Pharmaceutical Business Intelligence & Analytics Suite'). 


The above two text boxes show the two different situations for the expression.


I have now changed my security to NTNAME authentification.  How can the same end result which i had for the application name be achieved with NTNAME security?


Regards.

1 Solution

Accepted Solutions
Not applicable
Author

your issue is the user portion of the OSUser is not in all capital letters

if you capitalize this portion Stratdigm - you should then get your expected result

View solution in original post

16 Replies
maxgro
MVP
MVP

did you try with osuser() to check for domain\username? it should be the same if you used above, with domain\user instead of   'CHITEMERERE CHRIS'

or       subfield(OSUser(), '\', 2)  if you want only the NT user

Not applicable
Author

OSUser uses the nt user name 9as opposed to the qlikview use) inclduing the domain name.  The format of the vlue in OSUser is domain\username.

There have been some inconsistant results reported when using OSUser() function when not used in conjuction with the Upper() function.

I have used the Upper(OSUser()) quite a bit to limit access to tabs based on the person accessing the applciation

Anonymous
Not applicable
Author

THANK you Maxgro.  I tried the following:

=If(OSUser() = subfield(OSUser(), '\', 2),'Advanced Pharmaceutical Business Intelligence & Analytics Suite', 'Pharmaceutical Business Intelligence & Analytics Suite')

The application name is:

Screen Shot 2015-12-16 at 20.32.38.png

which is not what is expected.

Anonymous
Not applicable
Author

Thank you Adam for the hint on use of USUser

Not applicable
Author

hope it helps

Anonymous
Not applicable
Author

Hi Adam, how would one use this Upper(OSUser()) under my situation?

Not applicable
Author

I have used it for security purposes in the past but for what you are showing in your original example, would somehting like this work?

=if (UPPER(OSuser())='domain\username1'
or UPPER(OSuser())='domain\usernam2'
or UPPER(OSuser())='domain\username3'
,'Advanced Pharmaceutical Business Intelligence & Analytics Suite', 'Pharmaceutical Business Intelligence & Analytics Suite')

based on the value of the OSUser, it will set the value accordingly.

Remember the value for osuser is the domain name\username where the user name is there network name (name they use when they log into their machine - yourr user name may be cchitemerer for example

Anonymous
Not applicable
Author

Thank you very much Adam.  I used the following expression as per your recommendation:

=If(Upper(OSUser()) = 'STRATDIGM_2\Stratdigm', 'Advanced Pharmaceutical Business Intelligence & Analytics Suite', 'Pharmaceutical Business Intelligence & Analytics Suite')

with the following results:

Screen Shot 2015-12-16 at 21.34.44.png

I thought this should now read "Advanced Pharmaceutical Business Intelligence & Analytics Suite"

Regads

Not applicable
Author

your issue is the user portion of the OSUser is not in all capital letters

if you capitalize this portion Stratdigm - you should then get your expected result