Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Section Access help

Morning All

Hopefully someone can help and highlight what I am doing wrong.

Attached is a very simple file using section access, and I am trying to set U1 (User 1) has admin rights and can see all and U2 (User 2) can only see part of the the data as a user.

However when I log in as U2 I get access denied (I am assuming it is because there are no matches as it allows access when strict Exclusion is unticked ?)

Log in as U1 to see script, and can anyone see what I have done wrong ?

I am sure it is something obvious but I am struggling to see it

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: Section Access help

Problem is in Capitalization (Upper Case) of the section access field. Try like:

SECTION  Access;


LOAD * INLINE [
    ACCESS, USERID, COMPANY_ID
    ADMIN, U1, Comp1
    ADMIN, U1, Comp2
    ADMIN, U1, Comp3
    ADMIN, U1, Comp7
    USER, U2, COMP1
    USER, U2, COMP2
];

SECTION Application;

Company_Data:
LOAD * INLINE [
    COMPANY_ID, COMPANY_ NAME
    COMP2, Company1
    COMP2, Company2
    Comp3, Company3
    Comp7, Company7
];

Exit Script;

Note:

After user login QlikView will attempt to copy the selections in

fields in section access to any fields in section application with exactly the same field names (the field

names must be written in UPPER CASE)

Hence, ideally you should load your Section Application data using Upper() like:

SECTION Application;

Load

          Upper(COMPANY_ID) as COMPANY_ID,

          COMPANY_NAME;

Company_Data:
LOAD * INLINE [
    COMPANY_ID, COMPANY_ NAME
    Comp1, Company1
    Comp2, Company2
    Comp3, Company3
    Comp7, Company7
];

5 Replies
MVP
MVP

Re: Section Access help

Problem is in Capitalization (Upper Case) of the section access field. Try like:

SECTION  Access;


LOAD * INLINE [
    ACCESS, USERID, COMPANY_ID
    ADMIN, U1, Comp1
    ADMIN, U1, Comp2
    ADMIN, U1, Comp3
    ADMIN, U1, Comp7
    USER, U2, COMP1
    USER, U2, COMP2
];

SECTION Application;

Company_Data:
LOAD * INLINE [
    COMPANY_ID, COMPANY_ NAME
    COMP2, Company1
    COMP2, Company2
    Comp3, Company3
    Comp7, Company7
];

Exit Script;

Note:

After user login QlikView will attempt to copy the selections in

fields in section access to any fields in section application with exactly the same field names (the field

names must be written in UPPER CASE)

Hence, ideally you should load your Section Application data using Upper() like:

SECTION Application;

Load

          Upper(COMPANY_ID) as COMPANY_ID,

          COMPANY_NAME;

Company_Data:
LOAD * INLINE [
    COMPANY_ID, COMPANY_ NAME
    Comp1, Company1
    Comp2, Company2
    Comp3, Company3
    Comp7, Company7
];

amit_saini
Honored Contributor III

Re: Section Access help

Hi Derek,

Please see the attachment, this appliaction will help you to build Section Access concept. Below are the credentials to open the application.

Username: admin

Pass: admin

Thanks,

AS

chauhans85
Esteemed Contributor

Re: Section Access help

see the attched file

take user ID as urs.....U1,U2

hope this helps

Not applicable

Re: Section Access help

Thank you tresesco

Worked a treat - However slightly strange why it needs to be upper case - but it is what it is ..... working now

MVP
MVP

Re: Section Access help

QV reads Section Access data as UPPER CASE, hence to match the same you have to convert the Application data as UPPER to match.

Community Browser