- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Aspiring_Developer ,
below is the example which i have taken and try to modify based on your need,
EmployeeData:
LOAD
*
INLINE [
EMPLOYEE_ID,EmployeeName,Designation,ParentId,SalaryData
1, Roy, 'Senior Manager', , 55
2, Tom, 'Team Lead', 1, 45
3, Roger, 'Business Analyst', 2, 12
4, Peter, 'Business Analyst', 5, 45
5, Adam, 'Team Lead',1, 63
];
[Ancestry Table temp]:
HierarchyBelongsTo(NodeID, AncestorID, NodeName, AncestorID, AncestorName, DepthDiff)
Load EMPLOYEE_ID as NodeID, ParentId as AncestorID, EmployeeName as NodeName Resident EmployeeData ;
[Ancestry Table]:
Load
NodeID,
NodeName,
AncestorID,
AncestorName as [Rollup Emp],
DepthDiff
Resident [Ancestry Table temp];
// drop temp table.
drop table [Ancestry Table temp];
Refer the page : Hierarchies in Qlik Sense - BigBear.ai
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Aspiring_Developer ,
from the above script, you will get Nodename and rollup emp, rollup emp should be NTNAME and Nodename should be renamed as NODENAME.
So while writing section access,
Section access;
Load
'USER' as ACCESS,
NTNAME ,
NODENAME
resident TableName;
So with the above table add the admin users as well, this will create a section access with hierarchy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,
Before implementing section access, you should create a hierarchy and then you have to include that hierarchy in section access, for example
ACCESS | USERID | JOB_LEVEL |
ADMIN | 614 | * |
USER | 615 | D |
USER | 615 | E |
USER | 701 | E |
USER | 888 | D |
USER | 888 | E |
So once you create this you can further use this to implement section access, to create a hierarchy, just check hierarchy and hierarchy belongs to function in qlik.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @GOKULAKANNAN
Thanks for your response. I tried the above approach . However, I don't know how to implement in my hierarchical data set . Could you please help me ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Aspiring_Developer ,
below is the example which i have taken and try to modify based on your need,
EmployeeData:
LOAD
*
INLINE [
EMPLOYEE_ID,EmployeeName,Designation,ParentId,SalaryData
1, Roy, 'Senior Manager', , 55
2, Tom, 'Team Lead', 1, 45
3, Roger, 'Business Analyst', 2, 12
4, Peter, 'Business Analyst', 5, 45
5, Adam, 'Team Lead',1, 63
];
[Ancestry Table temp]:
HierarchyBelongsTo(NodeID, AncestorID, NodeName, AncestorID, AncestorName, DepthDiff)
Load EMPLOYEE_ID as NodeID, ParentId as AncestorID, EmployeeName as NodeName Resident EmployeeData ;
[Ancestry Table]:
Load
NodeID,
NodeName,
AncestorID,
AncestorName as [Rollup Emp],
DepthDiff
Resident [Ancestry Table temp];
// drop temp table.
drop table [Ancestry Table temp];
Refer the page : Hierarchies in Qlik Sense - BigBear.ai
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your response. I've gone through the links and code snippets and this is what my code looks like :-
Data Model Viewer
We are not linking the two tables as it fact table measures should not be impacted by the filters of Ancestory table
I am very new to this hierarchical concept and not sure what to do next .Can anyone please help me on this ?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Aspiring_Developer ,
from the above script, you will get Nodename and rollup emp, rollup emp should be NTNAME and Nodename should be renamed as NODENAME.
So while writing section access,
Section access;
Load
'USER' as ACCESS,
NTNAME ,
NODENAME
resident TableName;
So with the above table add the admin users as well, this will create a section access with hierarchy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your response .
I tried below script and even added my ID and name in it in order to see the application myself in the section access :-
After reload , it is giving me below :-
Not sure , what I did wrong ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Aspiring_Developer ,
If you have a domain name then you have to add it, to find the domain name, inside the sheet create a KPI and add OSuser() as a measure , you will get 2 things, first one is domain , second one will be your user id, so for example , RE is domain, and GK is id, u have to mention it like "RE\GK" as NTNAME. Then only it will work, else it wont.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please see below :-
I think I am making some mistake here in the section access script :-
Am not sure about the section access script . Do I need to define the rules here , not sure 😞
- « Previous Replies
-
- 1
- 2
- Next Replies »