Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Basically I'm trying to implement section access via the QlikSense Load Script.
This is my current code (I changed the names and some field names):
Star is *;
Section Access;
// Allgemeiner Zugang zur Applikation
Berechtigungen:
Load * Inline [
ACCESS, USERID, REDUCTION, OMIT
ADMIN, INTERNAL\SA_SCHEDULER, * ,
ADMIN, AD\USER1, *,
ADMIN, AD\USER2, *,
ADMIN, AD\USER3, TEST,
];
Concatenate (Berechtigungen)
Load
'USER' As ACCESS,
User As USERID,
If("MVZ Kürzel" = 'MUKM2', 'MUKM', "MVZ Kürzel") As REDUCTION,
'' As OMIT
From [lib://X-Berechtigungen/Berechtigungen.xlsx]
(ooxml, embedded labels, table is MVZ)
Where Aktiv = 'ja';
Section Application;
// Verbindung der MVZ-Felder für den Zugriff.
MVZ_Security:
Load Distinct
Upper([MVZ-Kürzel]) As REDUCTION,
[MVZ-Kürzel]
From [lib://MVZ-Sense/DVMvz.xlsx]
(ooxml, embedded labels, table is [Access]);
So, I am USER1 and (from my understanding) should be allowed to see all values of the REDUCTION field which are present in the access table - which should be TEST and the values I loaded from the Excel file.
If I switch the REDUCTION field for USER3 to *, this works. But if I run this like you see above, I am also limited to just the TEST value for the reduction field, although I loaded the remaining possible values from the Excel file and concatenating them afterwards - what am I missing here?
Thanks!
Maybe could you do test removing the section access keyword in order to check what is really loaded in [Berechtigungen]?
Okay, I just found out myself 😅.
So, just in case anyone else finds himself in this situation:
The problem is the Where clause when loading the Excel-file. QS converts every field to uppercase when used in the section access, so instead of
Where Aktiv = 'ja';
You'd have to use (just added the UPPER for clarification reasons):
Where Upper(Aktiv) = 'JA';
This way, my script is working just as it should.
Nevertheless thanks for your input!
What happens if your revers the load-order and loading at first from the Excel and then adding the inline-admin-stuff?
Hi @alliedarmour ,
Could you create a sample qvw document with mock data with the actual vs expected result regarding data reduction per user?
Of course you would need to use only custom users as below:
Section Access;
LOAD * INLINE [
ACCESS, USERID, PASSWORD, NTNAME
USER, USER1, PWD1, *
USER, USER2, PWD2, *
ADMIN, ADMIN, ADM, *
];
Maybe could you do test removing the section access keyword in order to check what is really loaded in [Berechtigungen]?
Okay, I just found out myself 😅.
So, just in case anyone else finds himself in this situation:
The problem is the Where clause when loading the Excel-file. QS converts every field to uppercase when used in the section access, so instead of
Where Aktiv = 'ja';
You'd have to use (just added the UPPER for clarification reasons):
Where Upper(Aktiv) = 'JA';
This way, my script is working just as it should.
Nevertheless thanks for your input!