Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

How to use wildcards in reduction fields in Section Access?

Hi,

I need to restrict users to see the data for particular codes only. For example, the codes are: abc123, abc145, a000, and 2000 more similar ones.

And some user see exact codes only:

user1, abc123.

But others should be able to see a set of codes:

user2, abc* (all that start with abc)

user3, a* (all that start with abc).

I tried using * wildcard in the reduction field, but it does not seem to recognise it; it treats it as an ordinary character (no matter if strict exclusion is on or off).

Do you know any solution? (ideally, I need a solution that will work properly when files are accessed locally and via access point)

Thank you,

1 Solution

Accepted Solutions
mov
Esteemed Contributor III

How to use wildcards in reduction fields in Section Access?

I would create a new field in section application for this purpose. See the example of the script:


SECTION ACCESS;
Access:
LOAD * INLINE [
ACCESS, USERID, SEC
ADMIN, ADMIN,
USER, U1, ABC123
USER, U2, ABC
USER, U3, A
];
SECTION APPLICATION;
Data:
LOAD * INLINE [
code
abc123
abc145
a000
2000];
JOIN (Data) LOAD DISTINCT
code,
upper(code) as SEC
RESIDENT Data;
JOIN (Data) LOAD DISTINCT
code,
upper(left(code,1)) as SEC
RESIDENT Data;
JOIN (Data) LOAD DISTINCT
code,
upper(left(code,3)) as SEC
RESIDENT Data;


3 Replies
MVP
MVP

How to use wildcards in reduction fields in Section Access?

I haven't played with section access, so I could be way off base. But I'd suggest looking at mappingwithwildcards.qvw in Rob Wunderlich's QlikView cookbook:

http://robwunderlich.com/Download.html

mov
Esteemed Contributor III

How to use wildcards in reduction fields in Section Access?

I would create a new field in section application for this purpose. See the example of the script:


SECTION ACCESS;
Access:
LOAD * INLINE [
ACCESS, USERID, SEC
ADMIN, ADMIN,
USER, U1, ABC123
USER, U2, ABC
USER, U3, A
];
SECTION APPLICATION;
Data:
LOAD * INLINE [
code
abc123
abc145
a000
2000];
JOIN (Data) LOAD DISTINCT
code,
upper(code) as SEC
RESIDENT Data;
JOIN (Data) LOAD DISTINCT
code,
upper(left(code,1)) as SEC
RESIDENT Data;
JOIN (Data) LOAD DISTINCT
code,
upper(left(code,3)) as SEC
RESIDENT Data;


Not applicable

How to use wildcards in reduction fields in Section Access?

Thank you Michael,

This was a helpful idea, I just modified it a little to match our data structure.

Now I have a satelite SA_table to my data table built as you suggested but with CONCATENATE instead of JOIN.

And it worked!

Cheers,

Dilyana

Community Browser