Skip to main content
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,

You are using SELECT (that queries the database manager) and OSUser() (QlikView function, so non existent in your DBM). But you can do something like that with a variable:

LET vCurrentUser = OSUser();

Table:

LOAD *;

SQL SELECT *

FROM "Europe_BI".dbo."D_SALES_REP"

WHERE SALES_REP_NT_ACCOUNT = '$(vCurrentUser)';

Since OSUser() returns a string, I quote the variable that returns the resulting value. Depending on your DB and your driver, you may need double quoting or something similar for strings.

Hope that makes sense this time.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable
Author

Thanks Miguel, it seems it works at least dosen't have a error. But sorry I have another question do you know how to see the content of the variable vcurrentuser, I like to see the content to the see how the information is retrieved.

Thanks very much for all help.

Fernando.

Miguel_Angel_Baeyens

Hi Fernando,

I assume you mean to see the value when the reload takes place. If so, then use the following code with the TRACE function (TRACE only writes in the progress dialog)

LET vCurrentUser = OSUser();

TRACE $(vCurrentUser);

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable
Author

Hi,

Is it possible/practical to read into QlikView the ntuser.dat file, directly or from a copy, to find the users in the system so that you don't need to hard code into the script NT user names that may change over time.

As I understand it this file can't be read as it's always open, making this more of an O/S question (Windows 7 Professional in my case) than a QlikView one. I just wonder whether anyone has tried to do this, or can see a need to do so.

Regards,

Jonathan