Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have the following data, and would like to show the last table but only for the "Unit" that "currentUser" is a member of. So in the below example what would be shown is this. Is this possible?
EMPLOYEES:
Load * Inline [
ID, SalesTeam, Unit
c1, carTeam1, cars
c2, carTeam2, cars
cLead, , cars
b1, bikeTeam1, bikes
b2, bikeTeam2, bikes
bLead, , bikes
];
Set currentUser = 'cLead'; // currently logged in user
SALES:
Load * Inline [
SalesTeam, Sales, Year
carTeam1, 100, 2019
carTeam1, 100, 2020
carTeam2, 100, 2019
carTeam2, 100, 2020
bikeTeam1, 20, 2019
bikeTeam1, 20, 2020
bikeTeam2, 20, 2019
bikeTeam2, 20, 2020
];
Hi @alenb ,
While applying section access field should be in the upper case. Please check the below updated script
Section Access;
Authorization:
LOAD * inline [
ACCESS, USERID, REDUCTION
ADMIN, MY_DOMAIN\ME, CARS
ADMIN, ABC\A, CARS
ADMIN, ABC\B, BIKES
ADMIN, AD_DOMAIN\ADMIN, *
ADMIN, INTERNAL\SA_SCHEDULER, *
];
Section Application;
EMPLOYEES:
Load * Inline [
ID, SalesTeam, Unit
c1, carTeam1, cars
c2, carTeam2, cars
cLead, , cars
b1, bikeTeam1, bikes
b2, bikeTeam2, bikes
bLead, , bikes
];
SALES:
Load * Inline [
SalesTeam, Sales, Year
carTeam1, 100, 2019,
carTeam1, 100, 2020
carTeam2, 100, 2019
carTeam2, 100, 2020
bikeTeam1, 20, 2019
bikeTeam1, 20, 2020
bikeTeam2, 20, 2019
bikeTeam2, 20, 2020
];
Join
Load SalesTeam, Unit, Upper(Unit) as REDUCTION Resident EMPLOYEES;
Hi @alenb ,
I will suggest using the Section access to achieve the output.
Thanks @abhijitnalekar , do you know of a simple example I could follow to solve the problem like I described with a Section Access?
Hi @alenb ,
Please go through with the below links to understand the Section access
https://www.youtube.com/watch?v=KgmACjjih-8
@abhijitnalekar Ah, the problem might be that for our apps, the IT admins have already established some section access rules, so would these new rules override those, or can I safely use them?
Hi @alenb ,
It will not affect any IT level rules.
Section access will be applied to the data only.
@abhijitnalekar I tried and it doesn't really work as it should, although it feels like the right way of doing it and I'd really like to get to the bottom of it. Thanks for sticking by.
Problem:
If I put 'cars' under REDUCTION for MY_DOMAIN\ME, then I see ALL records, although should only see the rows with REDUCTION 'cars' in them.
Section Access;
Authorization:
LOAD * inline [
ACCESS, USERID, REDUCTION
ADMIN, MY_DOMAIN\ME, cars // ---------- This is me
ADMIN, ABC\A, cars
ADMIN, ABC\B, bikes
ADMIN, AD_DOMAIN\ADMIN, *
ADMIN, INTERNAL\SA_SCHEDULER, *
];
Section Application;
EMPLOYEES:
Load * Inline [
ID, SalesTeam, Unit
c1, carTeam1, cars
c2, carTeam2, cars
cLead, , cars
b1, bikeTeam1, bikes
b2, bikeTeam2, bikes
bLead, , bikes
];
SALES:
Load * Inline [
SalesTeam, Sales, Year
carTeam1, 100, 2019,
carTeam1, 100, 2020
carTeam2, 100, 2019
carTeam2, 100, 2020
bikeTeam1, 20, 2019
bikeTeam1, 20, 2020
bikeTeam2, 20, 2019
bikeTeam2, 20, 2020
];
Join
Load SalesTeam, Unit, Unit as REDUCTION Resident EMPLOYEES;
Drop Table EMPLOYEES; // I'm dropping this to avoid synthetic keys but would in reality keep this data
Hi @alenb ,
While applying section access field should be in the upper case. Please check the below updated script
Section Access;
Authorization:
LOAD * inline [
ACCESS, USERID, REDUCTION
ADMIN, MY_DOMAIN\ME, CARS
ADMIN, ABC\A, CARS
ADMIN, ABC\B, BIKES
ADMIN, AD_DOMAIN\ADMIN, *
ADMIN, INTERNAL\SA_SCHEDULER, *
];
Section Application;
EMPLOYEES:
Load * Inline [
ID, SalesTeam, Unit
c1, carTeam1, cars
c2, carTeam2, cars
cLead, , cars
b1, bikeTeam1, bikes
b2, bikeTeam2, bikes
bLead, , bikes
];
SALES:
Load * Inline [
SalesTeam, Sales, Year
carTeam1, 100, 2019,
carTeam1, 100, 2020
carTeam2, 100, 2019
carTeam2, 100, 2020
bikeTeam1, 20, 2019
bikeTeam1, 20, 2020
bikeTeam2, 20, 2019
bikeTeam2, 20, 2020
];
Join
Load SalesTeam, Unit, Upper(Unit) as REDUCTION Resident EMPLOYEES;
@abhijitnalekar Works like a charm 👍