Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Retrieve the NTuser into qlikview

Hello,

I need to retrieve the NT user account into the qlikview file , anyone knows if is possible and what is the code for this.

Thanks and Regards,

Fernando.

13 Replies
Miguel_Angel_Baeyens

Hi Fernando,

I don't know what do you want exactly, but you can use the function OSUser() to get the current user account in the form DOMAIN\USERNAME

Is that what you were looking for?

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

isaiah82
Creator III
Creator III

Fernando ~ can you clarify what exactly is it you are trying to do?  There is a function OSUser() which will return the currently logged in user, but I'm not sure that's what you're after...

-Isaiah

Not applicable
Author

That’s excatly what I want, but what is exactly the code in script to retrieve this value ? I need this value in a field to use this field in a script to exclude some records from one file.

Thanks and regards

Fernando.

Not applicable
Author

That’s exactly what I want, but what is exactly the code in script to retrieve this value? , I need this value in a field  to use in a script to exclude some records in a SQL.

Thanks and regards

Miguel_Angel_Baeyens

Fernando,

The following should work, but it will always return the user running the reload:

Table:

LOAD *,

FROM File

WHERE OSUser() = 'DOMAIN\GRANTEDUSER';

If you want some users to see only some pieces of information, I'd use instead section access, which gives you further control on the same application on what can any given user see. There are a lot of information on how to build a section access if you never did before, but this and this and this threads are a good start point. Check the Documents

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable
Author

Thanks very much I will try and let you know the feedback

Not applicable
Author

Hello Miguel,

I try to do it and I receive a error message  'OSUser' is not a recognized built-in function name , do you have a clue what could be , is necessary to do any else in the script?

Thanks and Regards,

Fernando.

Miguel_Angel_Baeyens

Hi Fernando,

Yes, I may misunderstood the question. This makes more sense to me

IF Upper(OSUser()) = 'DOMAIN\USERNAME' THEN

Table:

LOAD *

FROM Source;

ELSEIF Upper(OSUser()) = 'DOMAIN\ADMIN' THEN

Table:

LOAD *

FROM Source2;

END IF

Hope that makes more sense.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable
Author

Hello Miguel,

Sorry but I don't understand what do you mean by this code.

I explain better my issue, I have a file with several employees and from this file I want to select only the one is login in .

I try the first time , this code as per your suggestion  as follow:

LOAD  *

SQL 

SELECT *
FROM "Europe_BI".dbo."D_SALES_REP" where "SALES_REP_NT_ACCOUNT" = OSUser();

and then gives me the error i told , how your last sugestion is apply to my need , sorry but I didn't understand.

Thanks very much for your help.

Fernando.