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: 
avinashelite

Need help on Section Access

Hi Friends,

Requirement: We have employee ID's and their Managers ID's, when the Manager login he should see that data related to him and his reporting employees but when Employee login he should see only his details.

To achieve this I am using section access and Hierarchybelongsto  function in script but not able to get the result.

Please see the attachment for Data and qvw file.

Give USERID as 1 or 2 or 3 or 4.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

In that case, try:

SECTION Access;

LOAD Upper(ACCESS) as ACCESS,

    USERID,

    Upper(USERID) as PERMISSION

PFA

View solution in original post

15 Replies
avinashelite
Author

Can any one help on this??

avinashelite
Author

Hi tresesco

I tried with that but its not working in my scenario. I need to implement section access on Employee Tree, so that the employee can see his details and this reporting employee details. Can you please help on this.

tresesco
MVP
MVP

Try to follow the steps shown in the blog and prepare a sample qvw with that and share here. That would help us understand your issue and could help accordingly.

avinashelite
Author

Hi tresesco,

Thanks a lot for the response, I have followed all the steps according to the Blog Post you specified but when i login as manger i.e. is with USERID 1 its showing only details of USERID 1, its not showing the details of his Reportees i.e the employees who are working under him.

Please find the attachment for  Data and qvw file.

Please use USERID as 1,2,3,4,5 . When 1 login in he should see the details of 1,2 and 5

similarly when 2 login he show see data of 2,3,4  and when 4 login he should see details of 4 only.

avinashelite
Author

Hi tresesco,

Any inputs on the above issue??

Anonymous
Not applicable

Hi,

see attached qvw.

Hope this helps.

Best regards

Stefan

tresesco
MVP
MVP

PFA

SECTION Access;
LOAD Upper(ACCESS) as ACCESS,
     USERID,
     Upper(Supervisor_id) as PERMISSION  // This authorisation field been added here
FROM
Sheet level section access.xlsx
(ooxml, embedded labels, table is Sheet1);

SECTION Application;   // Heirarchy making comes under section application
THierarchy:

HierarchyBelongsTo(USERID,Supervisor_id,Name,AncestorID,AncestorName)

Load * Inline [
USERID,Name,Supervisor_id
1,A,0
2,B,1
3,C,2
4,D,2
5,E,1
];


Hierarchy:
Load
Name as NAME,
//USERID,
AncestorID,
Upper(AncestorID) as PERMISSION

Resident THierarchy;
DROP Table THierarchy;

Fact:
load * inline
[
NAME,SALARY,PROJECT
A,10000,QA
B,40000,QIS
C,25000,QCT
D,30000,SFDC
E,45000,LMS
];

avinashelite
Author

Hi tresesco

Thanks a lot for the quick response, my requirement is

when a certain employee logs in, he should only see this own tree (his own data and down)

BUT he shouldn't see any facts on the upper nodes in the tree. But in your app file its showing all the data.

When user 1 login I am able to see all the data this is fine, but when 2 login still its showing all the data??

he is the manager for C and D . so he should see only this data and c and D 's data not his managers data.