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

Section Access not working on a linked table

Hi, I'm working on implementing Section Access to the Apps. I want to restict user's access based on assigned country. Country table is linked with the Plant table through the PK/FK. Country is also linked with Region table through the PK/FK.

When I'm assigning to user specific Plant it works correctly (user only sees this plant) but when I assign to user specific Country he sees every Region, Country and Plant.

This is the query I use:

Section Access;
LOAD * inline [
ACCESS, USERID, REDUCTION
ADMIN, DOMAIN\USER1,
USER, DOMAIN\USER2, USA
];
Section Application;
LIB CONNECT TO 'Database';

LOAD Id,
RegionName;

[Region]:
SELECT Id,
RegionName
FROM db.dbo.Region;

LOAD Id,
CountryName AS REDUCTION,
RegionId;

[Country]:
SELECT Id,
CountryName,
RegionId
FROM db.dbo.Country;

LOAD Id ,
PlantName,
CountryId;

[Plant]:
SELECT Id,
PlantName,
CountryId
FROM db.dbo.Plant;

After I load data and make connection between tables. I display data in a table consisting of 3 columns (Region,Country,Plant). User1 should see everything and User2 should see only Plants from USA. But everyone sees everything. What am I doing wrong?

Labels (2)
1 Solution

Accepted Solutions
micheledenardi
Specialist II
Specialist II

All field names must be written in uppercase in section access.

If you need the values in original case in your dashboard create one field in upper case for section access in order to leave the original one with the default case to use in your dashboard:

 

 

Load
   Upper(Country) as [SectionAccess_Country],  //For Section Access
   Country                                     //For dashboard & layout
From.....

 

 

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

3 Replies
micheledenardi
Specialist II
Specialist II

Try to disable Section Access; and Section Application; statements then check if USER1 and USER2 are correctly associated to the data model as expected. Are you sure CountryName  is in upper case?

In case please upload some example data to check what's wrong in your datamodel.

 

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
matKa
Contributor III
Contributor III
Author

After I converted values loaded from the Database to be Uppercase it started to work. But what if I want the data in the dashboard in it's default state. For example Portugal and not PORTUGAL.

micheledenardi
Specialist II
Specialist II

All field names must be written in uppercase in section access.

If you need the values in original case in your dashboard create one field in upper case for section access in order to leave the original one with the default case to use in your dashboard:

 

 

Load
   Upper(Country) as [SectionAccess_Country],  //For Section Access
   Country                                     //For dashboard & layout
From.....

 

 

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.