Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report

QlikView Section Access Examples

cancel
Showing results for 
Search instead for 
Did you mean: 
Colin-Albert

QlikView Section Access Examples

Last Update:

Oct 7, 2022 9:22:04 AM

Updated By:

Sonja_Bauernfeind

Created date:

Feb 24, 2014 6:54:29 PM

Attachments

The  attached file SectionAccess.zip contains several example documents that show how Section Access can be used to restrict access to specific users and to specific data.

 

This is not a guide on how to use Section Access, but instead shows some of the common errors and how to avoid them.

 

An excellent guide to Section Access can be found here http://community.qlik.com/docs/DOC-1853

Marcus_Sommer has accumulated a comprehensive list of Section Access Resources in this document Section Access

 

These examples will require a licenced copy of QlikView to open them, so they not suitable for users with QlikView Personal Edition.

 

The example documents will ask for a username and password to open them and set the Section Access permissions. The following usernames and passwords can be used to open the documents and see the different functionality with Section Access. When changing from one user to another, you must close QlikView before you can open a document as another user.

UserID,  Password

ADMIN,  ADMIN

JOHN, JOHN

MARY,  MARY

PETER,  PETER

SIMON,  SIMON

 

You can view the load script to see how the Section Access and data is configured.

 

Section Access Example 1

This document attempt to restrict access to a list of named users, but this fails as the section access field names are not set as UPPERCASE in the script.

 

Section Access Example 2

The app is now correct and prompts for a username and password before users can access the data.

 

Examples 1 & 2 use the Basic section access data from SectionAccess.xlsx

 

Access,  UserID,  Password

USER,  USER,  USER

ADMIN,  ADMIN,  ADMIN

USER,  JOHN,  JOHN

USER,  MARY,  MARY

USER,  PETER,  PETER

ADMIN,  SIMON,  SIMON

 

Section Access Example 3

The data is restricted so users can only access the Cost Centre data as listed in the Cost Centre  column in Section Access.

Access,  UserID,  Password,  CostCentre

USER,  USER,  USER,  *

ADMIN,  ADMIN,  ADMIN,  *

USER,  JOHN,  JOHN,  A

USER,  MARY,  MARY,  B

USER,  PETER,  PETER,  C

ADMIN,  SIMON,  SIMON,  A

 

Section Access Example 4

This adds extra DUMMY rows to the section access table so the * entries can now access all cost centres.

Access,  UserID,  Password,  CostCentre

USER,  USER,  USER,  *

ADMIN,  ADMIN,  ADMIN,  *

USER,  JOHN,  JOHN,  A

USER,  MARY,  MARY,  B

USER,  PETER,  PETER,  C

ADMIN,  SIMON,  SIMON,  A

DUMMY,  DUMMY,  DUMMY,  D

DUMMY,  DUMMY,  DUMMY,  E

DUMMY,  DUMMY,  DUMMY,  F

DUMMY,  DUMMY,  DUMMY,  G

DUMMY,  DUMMY,  DUMMY,  H

 

Note – you cannot open the document as user DUMMY because DUMMY is an invalid Access value, only ADMIN and USER entries are allowed to open the document.

 

Section Access Example 5

This adds Region to the restrictions as well as CostCentre, but the restriction on Region fails as the

region fieldname is not UPPERCASE.

 

Access,  UserID,  Password,  CostCentre,  Region

USER,  USER,  USER,  *,  *

ADMIN,  ADMIN,  ADMIN,  *,  *

USER,  JOHN,  JOHN,  A,  North

USER,  MARY,  MARY,  B,  South

USER,  PETER,  PETER,  C,  East

ADMIN,  SIMON,  SIMON,  A,  North

ADMIN,  SIMON,  SIMON,  A,  East

DUMMY,  DUMMY,  DUMMY,  D,  North

DUMMY,  DUMMY,  DUMMY,  E,  South

DUMMY,  DUMMY,  DUMMY,  F,  East

DUMMY,  DUMMY,  DUMMY,  G,  West

DUMMY,  DUMMY,  DUMMY,  H

 

Section Access Example 6

The Region fieldname is uppercase, but the restriction on Region still fails as the region data is not UPPERCASE.

 

Section Access Example 7

The Region restriction now works by loading the region data into a second field named REGION_SA and forcing the data in REGION_SA to UPPERCASE.

Version3 - The Region field has been removed from the Section Access table. This fixes the error identified by kanhomcake (March 27 2014).

 

Hopefully this will help avoid some of the basic errors that can be made when implementing Section Access.

 

Colin Albert.

Labels (1)
Comments
Anonymous
Not applicable

The issue where profiles of type USER cannot open the document is because of the strict exclusion setting. The ADMIN profile allows for the document to be opened when this setting is checked. However USERS cannot. Therefore examples 5 and 6 will fail the strict exclusion test because initially the field NAME must be upper case then the field VALUE must be uppercase.

As per code above example 7 fails this test because the section access example still has REGION. Therefore this join will fail the strict exclusion test.

Not applicable

A very useful example.

I have an issue that I just cannot get my head around with the access restrictions required in my document.

I have multiple countries and most users are to be allowed access to the Global value and their own country only. I can restrict them to their country but cannot get them to see the Global picture (i.e. Country is Null).

I am using buttons to control country selection so possibly the Section Access is not the right place to control the views.

Any help appreciated!

Colin-Albert

Hi Andrew,

The Global picture (no Country selected) actually means that all Countries are selected in QlikView logic.

So if your section access is restricting a users to only view one country, then that one country is all they can see as a global view.

One possibile solution may to be combine all counties data into an extra country named ALL and add this data to the fact table, then allow users to access two specific countries - their own country and ALL. This way a user could see the overall figures but not the specific data for any one country apart from their own.

Not applicable

Hi Collin,

Thanks for this awesome post, Its really helpful. I have used this in my personal edition to reduce data volume based on filters and giving different users access to different region based on their need.

However can you add a couple of more lines to do the same data reduction from the QMC as well, restricting data for a partcular user.

It will really helpful.

Regards,

Roy

Not applicable

How the ACCESS ADMIN in SECTION ACCESS see all the sheet?

Not applicable

Resolved, like this:

Section Access;

LOAD * INLINE [

  ACCESS,USERID,PASSWORD,ABAS

  ADMIN,ADMIN,admpre,

    USER,000005,Rona5per,1

  USER,000161,Fla1440b,2

  USER,000162,marco162,3

];

Section Application;

Abas:

LOAD * INLINE [

    ABAS, Descrição

    , Financeiro

    , Comercial

    , Logística   

    1, Financeiro

    2, Comercial

    3, Logística

];

And, in sheet  properties put in Conditional ABAS=2 or ABAS='' for the respective sheet.

Not applicable

I've checked   "Initial Data Reduction Based on Section Access”  & “Strict Exclusion” & “Prohibit Binary Load”, but it dosn't work. So I've checked "Initial Selection Based on Section Access” then it works.

What's the problem?

Colin-Albert

If you tick Strict Exclusion and your login has no access to any data based on the section access rules defined in your section access script, then the document will not open.

If you untick Strict Exclusion and your login has no access based on your section access rules, then the document will open and you will see ALL data. This is not what you want in a secured environment.

The behaviour you are seeing is section access working correctly.

Strict Exclusion is doing exactly what it is designed to do.

Not applicable

Thanks for your reponse.

I follow the document of Introduction_to_Section_Access_-_Rev_1-1.pdf  example 1, but when I've reloaded the script , the error happens for loaded the data! It's not normal.

I don't find out what is the problem.

Colin-Albert

These posts have more details of Section Access and Strict Exclusion

Section Access: Strict Exclusion

A Primer on Section Access

Version history
Last update:
‎2022-10-07 09:22 AM
Updated by: