Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Multiple Reduction Fields in Section Access

Hi

I need to be able to do data reduction on section access information for 2 reduction fields, salesperson and branch.

Each user (non-ADMIN) will only have information for one of the 2 fields, I don't want to restrict the data on the other field. If the user is a salesperson I want all the information for that salesperson. If the user is a branch manager I want only the information for that branch but all the salespeople who sold at that branch.

The two fields are linked in a hierarchy. The sales are recorded to a salesperson but not to a branch because the branch is picked up from the hierarchy as below.

BRANCH SALESPERSON

1 1

1 2

2 3

2 4

I bring in the section access from a table in Excel (attached):

I tried leaving out the wildcards, this didn't work at all, no user could open document. With the table as it is Users A-D can open document correctly but users E & F can't.

Any ideas on how to fix this? I did include "Star is *;"





4 Replies
Not applicable

Multiple Reduction Fields in Section Access

Did you ever get a response to this? It seems like a common scenario to have a hierarchy for section access with varying levels of access/reduction.

Not applicable

Multiple Reduction Fields in Section Access

You have to set up separate access tables for each level in the hierarchy

Not applicable

Multiple Reduction Fields in Section Access

Would you happen to have an example of what this would look like in the QV code?

Not applicable

Multiple Reduction Fields in Section Access













set

zModel = "**Your security spreadsheet name**";

Section

Access;

//$(Include=security.qvs)

USERS:

LOAD

LEVEL

as ACCESS

,

'*'

as USERID

,

'*'

as PASSWORD

,

USER

as NTNAME

,

GROUPNO

as GROUPNO1

,

GROUPNO

as GROUPNO2

,

GROUPNO

as GROUPNO3

,

GROUPNO

as

GROUPNO4

FROM

[$(zModel).xlsx]

(

ooxml, embedded labels, table is USERLIST)

;





Section

Application;

star

is *;

let

z1=1;

for

each z in 'Level1','Level2','Level3'

"SECURITY$(z)":

LOAD

GROUPNO

as GROUPNO$(z1),

$(z)

_NAME

FROM

[$(zModel).xlsx]

(

ooxml, embedded labels, table is GROUPS);

let

z1 = z1 + 1;

next

z;







Community Browser