Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

How to implement Section Access based on partial string match

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

Re: How to implement Section Access based on partial string match

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.

garystrader
Contributor III

How to implement Section Access based on partial string match

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

How to implement Section Access based on partial string match

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

Community Browser