Qlik Community

Ask a Question

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Specify values to exclude in Section Access

Is it possible to define values in a field to exclude for specific users in Section Access?

For instance, an organisation may have 500 products and they want users to see all of them except 5.  Instead of specifying 495 products a user does have access to, can you specify the 5 that should be excluded?

4 Replies
MVP & Luminary
MVP & Luminary

Hi,

You can do this by arriving a additional Field like ProductCategory which has two values like 'Show', 'Hide' in the Products table.  All the 495 products should have 'Show' value and the remaining 5 Products should have 'Hide'.

You can use similar script like this

Section Access;

LOAD * INLINE [

    ACCESS, USERID, PASSWORD, REDUCTION

    ADMIN, Admin, password, *

    USER, Sales, password1, 1   

];

Section Application;

star is *;

Departments:

LOAD * INLINE [

   REDUCTION, ProductCategory

    1, Show

    2, Hide];

Sales:

LOAD

     *,

     If(Match(Product, 'Product1', 'Product2', 'Product3','Product4','Product5'), 'Hide', 'Show') AS ProductCategory //Product 1-5 are products to hide from users

FROM DataSource;

Finally, you should select Settings -> Document Properties -> Opening tab -> select  "Initial Data Reduction based on Section Access"

Hope this helps you.

Regards,

Jagan.

Not applicable

Thanks for the reply Jagan.

This would work, but it is not as elegant as it could be with an "exclude" or "not in" style function.

MVP & Luminary
MVP & Luminary

Hi,

You can try Exclude(Exists()) or Not In would exclude the data from the Qlikview file.  Is it ok for you.  But the above solution will keep the data in Qlikview file and show/hides the data based on the logged in user.

Regards,

Jagan.

Not applicable

The first option is preferable.  There would be users who need to view all data.