Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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?
BI Consultant
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
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.
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
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.
BI Consultant
Thanks very much I will try and let you know the feedback
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.
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.
BI Consultant
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.