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

Section access query

Hi

I am trying to apply section access and Section application to an app, but when following the script below it creates me a synthetic Key.

I have a main data table from where I am I have 4 fields that would work as fields for data reduction, Cluster, Country, Location and BU.

If I do the section access with only one field it works well, but if I try to use one additional reduction field it creates the synthetic key.

Any suggestion?

8 Replies
MK9885
Master II
Master II

Can you post your Section Access script here?

jgarciaf106
Creator
Creator
Author

Section Access;

LOAD * INLINE [

    ACCESS, USERID, PASSWORD, %CLUSTER, %COUNTRY, %LOCATION, %BU

    ADMIN, ADMIN, 123, *, *, *, *

    USER, USER1, 123, C1, USA, *, *

    USER, USER2, 123, C2, CANADA, LOCATION1, *

];

Section Application;

LOAD * INLINE [

    Cluster, %CLUSTER, Country, %COUNTRY, Location, %LOCATION, Bu, %BU

    C1, C1, USA, USA, Location1, LOCATION1, bu1, BU1

    C2, C2, Canada, CANADA, Location2, LOCATION2, bu2, BU2

];

Ricardo_Gerhard
Employee
Employee

Hi Andres,

Try to reproduce and improve your skill base on this link:

http://help.qlik.com/en-US/sense/September2017/Subsystems/Hub/Content/Scripting/Security/manage-secu...

PS: the section access will be applied when reloaded and published on stream. Reload, Publish and close the browser.

Ricardo Gerhard
OEM Solution Architect
LATAM
MK9885
Master II
Master II

Section Access;

LOAD * INLINE [

    ACCESS, USERID, PASSWORD, %CLUSTER, %COUNTRY, %LOCATION, %BU

    ADMIN, ADMIN, 123, *, *, *, *

    USER, USER1, 123, C1, USA, *, *

    USER, USER2, 123, C2, CANADA, LOCATION1, *

];

Section Application;

LOAD * INLINE [

    Cluster, %CLUSTER, Country, %COUNTRY, Location, %LOCATION, Bu, %BU

    C1, C1, USA, USA, Location1, LOCATION1, bu1, BU1

    C2, C2, Canada, CANADA, Location2, LOCATION2, bu2, BU2

];


why are you using 2nd Inline table?


Adding service account to Section Access may work plus using Star is *; before section Access but I don't get why 2nd table i being used?

MK9885
Master II
Master II

Star is *;

LOAD * INLINE [

ACCESS, USERID, PASSWORD, %CLUSTER, %COUNTRY, %LOCATION, %BU

    ADMIN, ADMIN, 123, *, *, *, *

    USER, USER1, 123, C1, USA, *, *

    USER, USER2, 123, C2, CANADA, LOCATION1, *

    ADMIN, INTERNAL/sa_scheduler, *, *, *, *.*

   ];

jgarciaf106
Creator
Creator
Author

I change a bit my section access Script when adding the Location  as reduction field It allows me to access only as Admin and User3, but It denies access to the rest of users and when i return as admin the data remains as User 3 reducted data, If I user two reductions fields It works really well

Section Access;

LOAD * INLINE [

    ACCESS, USERID, PASSWORD, CLUSTER, COUNTRY, LOCATION,

    ADMIN, ADMIN1, 123, *, *, *,

    USER, USER1, 123, Argentina, Uruguay, *,

    USER, USER2, 123, Brazil, *, *,

    USER, USER3, 123, Caricam, Costa Rica,Terra Campus,

    USER, USER4, 123, Mexico,  *, *,

    USER, USER5, 123, Pacific, Ecuador, *,

];

Section Application;

Section Application;

SecApp1:

LOAD

    Cluster,       

    Upper(Cluster) as CLUSTER   

FROM

(qvd);

SceApp2:

LOAD

    Country,

    Upper(Country) as COUNTRY

FROM

(qvd);

SceApp3:

LOAD

    Location,

    Upper(Location) as LOCATION

FROM

(qvd);

SceApp4:

LOAD

    Business_Unit,

    Upper(Business_Unit) as BUSINESS_UNIT

FROM

(qvd);

rittermd
Master
Master

I believe that the userid needs to contain the Domain (The User Directory that it was loaded from).  Displayed in the QMC

So:

Domain\User1

MK9885
Master II
Master II

Star is *;

Section Access;

SA:

LOAD

           

    Upper(Cluster) as CLUSTER,

    Upper(Country) as COUNTRY,

    Upper(Location) as LOCATION,

    Upper(Business_Unit) as BUSINESS_UNIT  

FROM

(qvd);

LOAD * INLINE [

    ACCESS, USERID,  CLUSTER, COUNTRY, LOCATION,

    ADMIN, INTERNAL/sa_scheduler,*,*,*

    USER, DOMAIN\USER1, ARGENTINA, URUGUAY, *

    USER, DOMAIN\USER2, BRAZIL, *, *

    USER, DOMAIN\USER3, CARICAM, COSTA RICA,TERRA CAMPUS

    USER, DOMAIN\USER4, MEXICO,  *, *,

    USER, DOMAIN\USER5, PACIFIC, ECUADOR, *

];

Section Application;

Try the above script.

I do not see the need to load your table every single time when you using Upper case when you loading it from same table.

Plus you don't need to add Password for users as it will be NTName based access.

If you are not sure about NTName for users, create a text box in test app and type in =OSUsers() in text box. This would give you NTName of different users logging in or search thru your AD or your User search in QMC.

If you get locked out then right click on the app and 'Open without Data' to modify the script.

Thanks.