Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
alenb
Partner
Partner

Filter the table based on variable

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?

alenb_0-1633677773787.png

 

 

 

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
];

1 Solution

Accepted Solutions
abhijitnalekar
Specialist
Specialist

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;

 

Regards,
Abhijit
keep Qliking...

View solution in original post

8 Replies
abhijitnalekar
Specialist
Specialist

Hi @alenb ,

 

I will suggest using the Section access to achieve the output. 

Regards,
Abhijit
keep Qliking...
alenb
Partner
Partner
Author

Thanks @abhijitnalekar , do you know of a simple example I could follow to solve the problem like I described with a Section Access? 

abhijitnalekar
Specialist
Specialist

Hi @alenb ,

Please go through with the below links to understand the Section access

https://www.youtube.com/watch?v=KgmACjjih-8

https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Scripting/Security/manag...

Regards,
Abhijit
keep Qliking...
alenb
Partner
Partner
Author

@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?

abhijitnalekar
Specialist
Specialist

Hi @alenb ,

It will not affect any IT level rules.

Section access will be applied to the data only.

Regards,
Abhijit
keep Qliking...
alenb
Partner
Partner
Author

@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

 

 

 

abhijitnalekar
Specialist
Specialist

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;

 

Regards,
Abhijit
keep Qliking...

View solution in original post

alenb
Partner
Partner
Author

@abhijitnalekar Works like a charm 👍