Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
stevelord
Specialist
Specialist

specify 'not <fieldvalue>' in a section access list?

Hi, below section access script is a whitelist approach to listing all the client some users can see.  First question is the real challenge, 2nd and 3rd questions I just want a yes/no reassurance/confirmation of.

Does anyone know a way or syntax for me to flip the list to simply list the one client these users cannot have access to?

If I leave a user off this list, will they have access to see all clients including ClientZ?

As it is currently written, would Admin1 and Admin2 have access to see all clients including ClientZ?

Section Access;

LOAD * INLINE [

ACCESS, NTNAME, ClientAccountName //ClientAccountName is the name of the field whose values I want to constrain by user, so related listboxes will only show values listed for the user.

ADMIN, Admin1

ADMIN, Admin2

USER, User1, Acme

USER, User1, …. (all of the clients except ClientZ)

USER, User1, Zacme

USER, User2, *

USER, User3, *

USER, User4, *

USER, User5, *

];

Section Application;

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

First of all, all field names (AND content) of the section acces table need to be in capitals.

Now, regarding your first question, only way I see this that you create a flag field, which in this case, set to 0 for ClientZ and 1 for all the other clients. Add this field to the section access and application part, and list 1 as value for the user you want to restrict this particular client

View solution in original post

7 Replies
stevelord
Specialist
Specialist
Author

Also what other document settings do I need to check or uncheck?  Above script doesn't seem to be working in and of itself.

Without the ClientAccountName column, it works fine with the 'filter accesspoint view by section access' document setting, so confident the section access table is fine.  I also don't see anything that indicates I need to apply it to the field like we apply mapping loads with an applymap() on the field...

(I am going through examples another person posted on qlikcommunity, but it's full of comments about this and that not working and many revisions happened..  They are restricting views, but not sure they're doing it in an expected way until I stare at them more.)

stigchel
Partner - Master
Partner - Master

In the document properties opeming tab set reduce data on opening and strict exclusion

stigchel
Partner - Master
Partner - Master

First of all, all field names (AND content) of the section acces table need to be in capitals.

Now, regarding your first question, only way I see this that you create a flag field, which in this case, set to 0 for ClientZ and 1 for all the other clients. Add this field to the section access and application part, and list 1 as value for the user you want to restrict this particular client

stigchel
Partner - Master
Partner - Master

I'm inclined to say, can't check right now, no access for question 2 and Yes for question 3

stevelord
Specialist
Specialist
Author

Flag field is a fantastic idea, I'm testing that now and will check back with correct answer points shortly! if(CLIENT='CLIENTZ',0,1) as RESTRICTED

Then my SA list will have RESTRICTED as the field name, and most people listed with a 1.

Then the short list of clientz people will have one line with a 1 and another line with the 0.

(Per rambling below, the blank turned out to not work on accesspoint.)

Interestingly, question 3 actually seems to be a yes for the qvw when I'm on the server, but a no when I try to open it from accesspoint web portal.  (It's a trash test qvw, but I have it backed up anyway. )

It's no problem though, it worked for me when I went back into the qvw on the server and put a * on one line, then CLIENTZ on the next line for myself, to give it the limited list + the client the other users can't see.

I confirmed by logging in to it on accesspoint as user A and saw 3 clients in the client listbox, then logged in as myself and saw the 3 clients + client Z.  (When I left myself blank on the client field, I get a 'Failed to open.  You do not have access!' when I click the document on accesspoint.. but I can go back into the qvw on the server- see all the clients there- and update the script to let it work for me on accesspoint...)

stevelord
Specialist
Specialist
Author

flag field idea was an all out slam dunk.  I will not have to manually add new clients to this list as new clients appear in the database- it will simply keep the restricted client off people's view unless I add a line for them to see that client.  The other beauty is I don't have to caps my client name list and make it look weird.

Final setup is this:

Section Access;

LOAD * INLINE [

ACCESS, NTNAME, RESTRICTED

USER, User1, 1

ADMIN, User2, 1

ADMIN, User2, 0

];

Section Application;

And in the table load with the ClientAccountName, I have a new field:

if(ClientAccountName='ZClient',0,1) as RESTRICTED

Thank you very much Mr. Hein for the quick and optimal solution.  (Trying to put a 'not' into the SA list might've been weird or impossible too.  Earlier today I had to do a 2-step solution on triggers elsewhere to make them select all but a particular invalid location on that particular qlikview too.)

stigchel
Partner - Master
Partner - Master

Thanks, the USER and ADMIN access only apply to offline distribution (to limit acces to document properties), hence the difference for accesspoint. The no access for blank is probably due to the strict exclusion, where none listed values will give no access, otherwise all. I tend to keep this always on, as any omission in the access table may result in unwanted access.