Qlik Community

Ask a Question

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Qlik Highlights 2020 Giveaway! Watch, reply and have a chance to win a $200 Amazon Gift Card! Watch Video
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to implement Section Access based on partial string match

When defining field values in Section Access, is it possible to use partial string matches?

For example, one user should only be able to see regions beginning with 'S', while another user should only be able to see regions beginning with 'NW'.  I would like to write something like the following, but it does not work:

LOAD * INLINE [

ACCESS, NTNAME, REGIONSECURITY

USER,user1,'R*'

USER,user2,'NW*']

4 Replies

Hi,

     It will work make sure whether you have checked the option .

     Document Properties-->Opening-->Strict data reduction based on section access to be enabled with strict exclusion.

     Fieldname of the region should also be REGIONSECURITY i mean the field in application section.

Celambarasan

Not applicable

I have just created a quick example and it does not seem to be working.  Please see my script:

SECTION Access;

LOAD * Inline [

ACCESS, USERID, REGIONSECURITY

ADMIN, admin,

USER, user1, 'S*'

USER, user2, 'NW*'

];

SECTION Application;

Locations:

LOAD * Inline [

REGIONSECURITY, Location

S1, South 1

S2, South 2

NW1, North West 1

NW2, North West 2];

If you open the app as "admin", you see everything.  If you try to open as "user1" or "user2", if gives the "Access denied to this QlikView document" message.

Partner
Partner

You could create a table that links your section access and Locations tables.  Something like this:

SECTION Access;

LOAD * Inline [
ACCESS, USERID, REGIONSECURITY
ADMIN, admin,
USER, user1,
user1
USER, user2, user2
];

SECTION Application;

Locations:
LOAD * Inline [
LocationKey, Location
S1, South 1
S2, South 2
NW1, North West 1
NW2, North West 2];

LocationWildcard:

LOAD

  'user1' as REGIONSECURITY,

  LocationKey

RESIDENT Locations

WHERE LocationKey like 'S*'

;

etc.

Not applicable

Thanks Gary. That looks like a solution that could work.