Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Or
Valued Contributor II

Section Application: security on field that may not exist

Dear all,

I am trying to set up QlikView on some HR data, with the following stipulations for security:

Each line from the time clock has data for the department the employee signed into.

Each department manager should be able to view all data for their department.

This has not been a problem - a simple, one-field Section Application achieved this with no problem. However, I now have a new stipulation:

People from HR should be able to see data for all employees, including those who have not reported any actual work.

In this situation, HR would still want to see the employee's general details (e.g. name, telephone, address, etc). However, because I am filtering based on the department line from the *actual work report*, any employee not appearing in this table (i.e. no actual work) is simply filtered out of the QVW entirely.

Sample data:

DateEmployeeHoursDEPARTMENT
1/1/201218IT
1/1/201228HR
2/2/201219IT
2/2/201237SALES

EmployeeNamePhone
1Joe Smith123
2John Doe456
3James White789
4Jennifer Smith555-555-5555

Section Application;

LOAD * INLINE [

USER, DEPARTMENT

ITMANAGER, IT

SALESMANAGER,SALES

HRManager, *

];

In this context, nobody would be able to view the details for Employee 4 (Jennifer Smith), because there is no department data associated with this employee.

I would like to set things up so HRManager could still see data for this employee. Moving the department data to the employee table is not feasible - it needs to be the department where said employee actually worked, not the one they are normally assigned to. I can't set up a basic two-field set of permissions, because it would create a loop.

Any ideas would be welcome.

Thanks in advance.

1 Solution

Accepted Solutions
MVP
MVP

Re: Section Application: security on field that may not exist

What about concatenating a list of all employees to your fact table, only with fields Employee and DEPARTEMENT (constant value 'HR') filled.

Section Application;

Hours:

LOAD Recno() as RecID,

     Date,

     Employee,

     Hours,

     DEPARTMENT

FROM

[http://community.qlik.com/thread/57559?tstart=0]

(html, codepage is 1252, embedded labels, table is @1);

Employees:

LOAD Employee,

     Name,

     Phone

FROM

[http://community.qlik.com/thread/57559?tstart=0]

(html, codepage is 1252, embedded labels, table is @2);

Concatenate (Hours) LOAD Employee, 'HR' as DEPARTMENT Resident Employees;

Reducing to DEPARTMENT value HR returns only hours worked for HR, but still all Employees, reducing to some other DEPARTMENT show only hours worked and related Employees for that department.

Hope this helps,

Stefan

1 Reply
MVP
MVP

Re: Section Application: security on field that may not exist

What about concatenating a list of all employees to your fact table, only with fields Employee and DEPARTEMENT (constant value 'HR') filled.

Section Application;

Hours:

LOAD Recno() as RecID,

     Date,

     Employee,

     Hours,

     DEPARTMENT

FROM

[http://community.qlik.com/thread/57559?tstart=0]

(html, codepage is 1252, embedded labels, table is @1);

Employees:

LOAD Employee,

     Name,

     Phone

FROM

[http://community.qlik.com/thread/57559?tstart=0]

(html, codepage is 1252, embedded labels, table is @2);

Concatenate (Hours) LOAD Employee, 'HR' as DEPARTMENT Resident Employees;

Reducing to DEPARTMENT value HR returns only hours worked for HR, but still all Employees, reducing to some other DEPARTMENT show only hours worked and related Employees for that department.

Hope this helps,

Stefan

Community Browser