Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Section Access- Different Field restriction for Filter

Hi all, How would one go about setting up section access based on more than one Dimension/Field?

I have the setup below but need to add an additional restriction (lets Call it OFFICE with Office_X and Office_Y).When I add an Office field to the Application below I get an error load about a circular loop in my model.

Any idea on what the syntax should look like in order to restrict data on an 'Office field' as well?


//Need to create a User that has access based on OFFICE?:
//Per Company
section Access;
LOAD * INLINE
[
ACCESS, USERID, PASSWORD, COMPANY
ADMIN, ADMIN, ADMIN
USER, PowerUser, letmein, *
USER, CompanyUser_X, letmein, X
USER, CompanyUser_Y_, letmein, Y

];

Section Application;
load * inline
[
COMPANY, Company
X, Company_X
Y, Company_Y

];


1 Solution

Accepted Solutions
Not applicable

Section Access- Different Field restriction for Filter

Hi Manish,

I would rather use this code:





section Access;

LOAD * INLINE [ ACCESS, USERID, PASSWORD, COMPANY_OFFICE
ADMIN, ADMIN, ADMIN
USER, PowerUser, letmein, *
USER, Company User_X, letmein, X
USER, CompanyUser_Y_, letmein, Y ];

Section Application;

[Company_office]:
load * inline [
COMPANY_OFFICE, COMPANY, OFFICE
X, COMPANY_X, OFFICE_X
Y, COMPANY_Y, OFFICE_Y
Y, COMPANY_Y, OFFICE_Y2

];


This way will help you to define different groups of companies and offices.

Pls keep me posted.

Sébastien



13 Replies
Not applicable

Section Access- Different Field restriction for Filter

Hi I thinkk the code you mentionned here is owrking.

But you should add a label for your inline table. If you don't a new name will be created at each reload of the application.

I would also avoid to have two fields names company (it is working because of the case but I would avoid it).

If you have a loop in your application, I doubt that it is because of this part of script...

Rgds,

Sébastien

manishkumar75
Contributor II

Section Access- Different Field restriction for Filter

Hi,

Can you please try the attached example ?

section Access;
LOAD * INLINE [
ACCESS, USERID, PASSWORD, COMPANY,OFFICE
ADMIN, ADMIN, ADMIN, ,
USER, PowerUser, letmein, , OFFICE_X
USER, abc, abc, X , OFFICE_X
USER, xyz, xyz, Y ,OFFICE_Y ];

Section Application;
load * inline [COMPANY, Company
X, Company_X
Y, Company_Y ];

Load * inline [OFFICE
OFFICE_X,
OFFICE_Y];

- Manish

Not applicable

Section Access- Different Field restriction for Filter

Hi Manish,

I would rather use this code:





section Access;

LOAD * INLINE [ ACCESS, USERID, PASSWORD, COMPANY_OFFICE
ADMIN, ADMIN, ADMIN
USER, PowerUser, letmein, *
USER, Company User_X, letmein, X
USER, CompanyUser_Y_, letmein, Y ];

Section Application;

[Company_office]:
load * inline [
COMPANY_OFFICE, COMPANY, OFFICE
X, COMPANY_X, OFFICE_X
Y, COMPANY_Y, OFFICE_Y
Y, COMPANY_Y, OFFICE_Y2

];


This way will help you to define different groups of companies and offices.

Pls keep me posted.

Sébastien



Not applicable

Section Access- Different Field restriction for Filter

Hi all,

Sorry for the late reply this project was put on the back burner for a while ...

Thank you all for the suggestions, I ended up using Sebastien's implementation. Although not a requirement now; it will not surprise me that at somepoint I may need to have more than one group/office combo.

Not applicable

AW:Re: Section Access- Different Field restriction for Filter

This looks good if you can define all values in both fields.

My idea is to define one value with data, e.g. in the field company and a wildcard in the field office.

No such idea what it has to look like.

I testes

load * inline

comany_office, company, office

X, company_x, *

Y, *, office_x

or

X, company_x,

Y,,office_x

but no match. In all cases the user can see....... no values.

Any ideas?

Regards

marcobombo
New Contributor

AW:Re: Section Access- Different Field restriction for Filter

Hi Marti,

I have the same prolem....have you resolved?

Thanks

MVP
MVP

AW:Re: Section Access- Different Field restriction for Filter

Hello,

Using "*" in section access doesn't mean "all values for field" but "all listed values for field within section access". If you want a user to get all information, set nothing instead the asterisk for any admin user, and as many lines as possible values for each user.

Hope that helps

EDIT: empty values will work for admin access, many lines will be needed for user access in case one user has access to more than one value in the reduction field, since this only allows one value per line.

marcobombo
New Contributor

AW:Re: Section Access- Different Field restriction for Filter

Hello,

now I have the problem that with this script

section access;

load * inline [

ACCESS,USERID,PASSWORD,OFFICE,EMPLOY

User,U1,U1,1,AAA

User,U2,U2,2,

User,U3,U3,,BBB];

section application;

load * inline [

amount,OFFICE,EMPLOY,number_question

10000,1,AAA,10

1200,1,AAA,20

1400,2,BBB,30

1500,2,BBB,40

5600,1,BBB,50

7000,3,AAA,60

8000,3,CCC,70

9000,4,BBB,80];

and the strikly exclusion the user U2 and U3 can not open the document.
Have any suggestion?
Thanks


MVP
MVP

AW:Re: Section Access- Different Field restriction for Filter

Hi,

I probably misled you with my previous post, the writing was confusing or incomplete.

As only one value per field is allowed in section access, should you want one user to get results from more than one value of that field (OFFICE or EMPLOY) you will need to add as many lines as values you want to get.

On the other hand, I've never used more than one reduction field, and if needed I've created a new table so one value in section access identifies one record in the reduction table. That may be causing some issues in your scenario.

Hope that helps

Community Browser