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

Usage of OSUSER()

Could any one pls. let me know, why my below code is not working fine?


LOAD USER,
[Legal Entity],
Division,
CompanyName,
FROM
[..\Data\Excel\SECURITYCAPEX.xlsx]
(
ooxml, embedded labels, table is Sheet1) where upper(USER) = upper(OSUser()); 


It works fine for only single time , then for other users its not  working.

1 Solution

Accepted Solutions
Colin-Albert

Allowing a user to only see their own data is part of Section Access in QlikView.

There are several good videos and this introduction for using section access.

http://community.qlik.com/docs/DOC-1853

The most important thing to remember is to have a safe backup copy of your app before you apply section access, as it is possible to completely lock yourself out of the document if the settings are incorrect or you forget the passwords.

View solution in original post

8 Replies
Anonymous
Not applicable

Hi,

this will reduce your dataset from your sheet to the osuser during reload.

Best Regards

Stefan

maxgro
MVP
MVP

with that code you'll get a table with records USER = OSUser of the last reload

when another user (OSUser) reloads the doc, he gets different rows depending on his OSUser

rahulhv1
Creator II
Creator II
Author

That is what I want. if some different user is using the document, data should get filtered for the user only.

Anonymous
Not applicable

Hi,

then you should use Section Access! This document may help:

http://community.qlik.com/blogs/qlikviewdesignblog/2014/05/26/section-access

section access will reduce the data bases on the user which opens the document.

Regards

Stefan

Colin-Albert

Allowing a user to only see their own data is part of Section Access in QlikView.

There are several good videos and this introduction for using section access.

http://community.qlik.com/docs/DOC-1853

The most important thing to remember is to have a safe backup copy of your app before you apply section access, as it is possible to completely lock yourself out of the document if the settings are incorrect or you forget the passwords.

jagan
Luminary Alumni
Luminary Alumni

Hi,

check this thread

Authentication and Authorization in Qlikview

Sample script in that link

Section Access;

LOAD * INLINE [

    ACCESS, USERID, PASSWORD, REDUCTION

    ADMIN, Admin, password, *

    USER, Sales, password1, 1

    USER, Market, password1, 2

];

Section Application;

star is *;

Departments:

LOAD * INLINE [

   REDUCTION, Dept,

    1, Sales

    2, Marketing];

Sales:

LOAD * INLINE [

   Dept, Sales

   Sales, 100

   Sales, 200

   Sales, 4646

   Sales, 755

   Sales, 422

   Sales, 42

   Marketing, 2

   Marketing, 453

   Marketing, 54

   Marketing, 45

];

When you login as Admin, you can see all data in the dashboard, when you login as Sales then you can see only Sales data and when you login as Market you can see only Marketing data.

User and password details for this application is

User Name     Password

Admin,           password

Sales,            password1

Market,          password1

Note: You need to select Document Properties -> Opening tab -> and select Initial Data Reduction based on Section Access option


Regards,

Jagan.

rahulhv1
Creator II
Creator II
Author

Thank you so much to  all.  I did different thing to achieve all above. and I got success in it.  Earlier also some one gave me example of Section access, but I wanted to avoid risk into it made it very simpler and got success in it , I did it exactly I wanted without using Section access.

jagan
Luminary Alumni
Luminary Alumni

Hi Rahul,

Please close this thread if you are done with this.

Regards,

Jagan.