Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Aspiring_Developer
Creator III
Creator III

Section access on Hierarchical data set qliksense

Hi Team ,

I have below data set :-

Employee ID Employee Name Designation Job Level Salary Data
614 Roy Senior Manager C 55
615 Tom Team Lead D 45
701 Roger Business Analyst E 12
751 Peter Business Analyst E 45
888 Adam Team Lead D 63

 

My requirement is we have a filter pane in the front end of 'Job Level'

When a user of job level C comes to see the dashboard , all the data should be visible . Now, when a user of job level D, see report , they should see their data and the data for career level E . Data for C level should not be visible , When a career level E sees, they should only see their data , no data for C, D should be visible . They should not be able to see the data for other E levels as well .

Can anyone please help ? I tried below code ,but is not working :-

Section Access;

// Security Rules
AccessTable:
LOAD * INLINE [
ACCESS, USERID, EMPLOYEE_ID, JOB_LEVEL
ADMIN, ADMIN, *, *
USER, 614, *, C
USER, 615, *, D
USER, 701, *, E
];

Section Application;

// Load your actual data
EmployeeData:
LOAD
EMPLOYEE_ID,
"Employee Name",
Designation,
JOB_LEVEL,
"Salary Data"
INLINE [
614, Roy, 'Senior Manager', C, 55
615, Tom, 'Team Lead', D, 45
701, Roger, 'Business Analyst', E, 12
751, Peter, 'Business Analyst', E, 45
888, Adam, 'Team Lead', D, 63
];

 

Can anyone please help me with this ? @tresesco @sunny_talwar 

Labels (1)
13 Replies
GOKULAKANNAN
Creator II
Creator II

Hi @Aspiring_Developer ,

Write this and execute

Section access;

Load * inline 

[

ACCESS,NTNAME,NODENAME

'ADMIN', ur user id with domain, *

,

 

];

Thus u include it after the section access; key word,and keep the existing code as it is

Aspiring_Developer
Creator III
Creator III
Author

Hi @GOKULAKANNAN 

Thank you very much for your help . 

My last question to you is If I talk about the rest of the users, Do, I need to add their details in the preceding load of section access . I have not yet tested it with other users . How their access rule will be replicated when they will log in. If I need to section access preceding load inline table , How will I define for the rest of the Employee _Id's ?

GOKULAKANNAN
Creator II
Creator II

Hi @Aspiring_Developer , If u want to create for other users, u have to mention the ID properly with the domain name, and give parent id properly and use hierarchy function and it will create a hierarchy, validate it once before you implement the section access.

NTNAME should be the parent name, NODENAME should be the child.

So if Roy is the manager he should be tagged with all his child values, so for roy 5 rows should be there (considering 4 employees)

In this way it will work, and u dont need to do anything else just to provide you the admin access we have added the inline in section access , that u have to keep, dont remove it

Aspiring_Developer
Creator III
Creator III
Author

Thanks a lot @GOKULAKANNAN for your help.

As you said I need to mention the ID properly with the domain name, and give parent id properly and use hierarchy function and it will create a hierarchy, validate it once before you implement the section access.

Where should I define these user id's and domain name . Could you please explain it with my data set . A small table ? 

This is my current script :-

Data:
Load * Inline [
Employee_ID, Employee_Name, Designation, Job_Level, Salary_Data
614, Roy, Senior Manager, C,55
615, Tom, Team Lead , D, 45
701, Roger, Business Analyst , E, 12
751, Peter, Business Analsyt, E, 45
888, Adam, Team Lead , D, 63
614142523,Vaishali, CEO,*, 79

];

Ancestory_Table_Temp:
HierarchyBelongsTo(NodeID,AncestorID,NodeName, AncestorID,AncestorName,DeptDiff)
Load Employee_ID as NodeID, Job_Level as AncestorID,Employee_Name as NodeName
Resident Data;


Ancestory_Table:
Load NodeID,
NodeName,
AncestorID,
AncestorName as [Rollup Emp],
DeptDiff
Resident Ancestory_Table_Temp;

drop table Ancestory_Table_Temp;

 


// Implementing Section Access---//

Section Access;

Load * inline

[

ACCESS,NTNAME,NODENAME

'ADMIN', IUSER\61414234, *,

];

Load

'USER' as ACCESS,

[Rollup Emp] as NTNAME ,

NodeName as NODENAME

resident Ancestory_Table;

Section Application;

 

What I need to do in the above script ?