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

=QVuser() vriable doesn't return a username

Hi Community,

I've tried to incorrporate qvuser() into my code for hidding and enabling sheets for certain users.  However, it hasn't worked so far and when I made a variable with code: =QVuser()  I get an empty variable.

Any ideas?

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

Hi,

Maybe you should use OSuser( ) instead of qvuser()

QVuser() will return a user that is entered and matched with username of section access. If you don't use that field for section access, you can only retrieve the system user which is osuser()

Hope it helps,

Erich

View solution in original post

8 Replies
swuehl
MVP
MVP

Are you using section access?

From the Help:

QVuser( )

Returns a string containing the name of the current QlikView user as entered in a section access.

Not applicable
Author

To be honest I don't know.  I went to the pdf QV reference manual and it talked about section access. 

I'm guessing maybe not, I do know that the server must be checking for credentials as people need to have there username added to documents in QEMC or else they can't access them. 

How would I check, is there another way to see the user, perhaps for the alternative I am using?

Not applicable
Author

Did you check if the QVuser() does give result when you open it from the accesspoint (where you have to login)?

I can imagine that there it works as expected, since in the accesspoint you login (with Active directory or something similar).

Not applicable
Author

For us , the url for access point internally is http://rbi/qlikview/  We don't have to login, it gets the credentials from the computer we are logged into (Forgive me, I have a math and science not computer background.)  We log in with Active Directory with our computers when we turn them on and can access access point without any further login info.

kamalqlik
Partner - Specialist
Partner - Specialist

Hi ,

In case You want to hide sheet for the Different user .

I can recommend you another method.

Go to the Sheet Properties->

In Show Sheet make it Conditional and Write the Condition=sum(SHEET1=1).

Now in the script...

write section access...statements

SECTION Access;

load USERID

FROM

(biff, embedded labels, table is Sheet2$);

left join

LOAD UPPER(USERID) AS USERID,

     //PASSWORD,

     ACCESS

FROM

(biff, embedded labels, table is Sheet1$);

SECTION Application;

LOAD UPPER(USERID) AS USERID,

     SHEET1,

     SHEET2,

     SHEET3,

     SHEET4,

     SHEET5,

     SHEET6

FROM

(biff, embedded labels, table is Sheet2$);

and now make an Excel.I am attaching the sample for Excel.

After that Go to Document properties->Check the CheckBox(Initail Data Reduction Based On Section Access).

Reload the Application.

Hope it helps.

Regards

Kamal

Not applicable
Author

The only thing is that this uses an excel file, how do I link it to that internal table on my server that has the list of users?

erichshiino
Partner - Master
Partner - Master

Hi,

Maybe you should use OSuser( ) instead of qvuser()

QVuser() will return a user that is entered and matched with username of section access. If you don't use that field for section access, you can only retrieve the system user which is osuser()

Hope it helps,

Erich

Not applicable
Author

Too funny Erich, I was just experimenting with that and got it to work!