Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
acrodrigues03
Partner - Contributor III
Partner - Contributor III

Section Access for Multiple Tables

Hi everyone,

 

I have multiple tables that I need to filtered based on the country from the section access. All of the tables contain a Country field, but I would like to hide them at the end. 

I have the following script right now: 

 

Section Access;
LOAD
"ACCESS",
"USERID",
UPPER("COUNTRY CODE") AS "COUNTRY"
FROM [lib://...\SECTION_ACCESS.qvd]
(qvd);

Section Application;

TABLE1:
LOAD
"Table 1 ID",
"COUNTRY"
FROM [lib://.../M_TABLE1.qvd](qvd);


TABLE2:
LOAD
"Table 2 ID",
"COUNTRY 2"
FROM [lib://.../M_TABLE2.qvd](qvd)

where exists ("COUNTRY","COUNTRY 2");

 

The issue is that this works for TABLE1 since they have the same field name but then the "where exists"  is not working in the other table to get only the ones that users are allowed to see. 

I could rename every country field in every table so it would match with the one in the section access, but then I would be doing unwanted connections. And also, if possible, I would like to not have the Country fields in the data model. 

 

Thank you

5 Replies
Sebastiaandb
Contributor III
Contributor III

Can't you just make another table combining the other tables without the country field and then drop the other tables? 🙂
acrodrigues03
Partner - Contributor III
Partner - Contributor III
Author

Hey Sebastian, 

Unfortunately, I can't, cause I have a country field in every table of the data model. And every table should be restricted, so I can't just do a combining table 

Or
MVP
MVP

You could use OMIT Country* in your section access, I think. If memory serves, Omit accepts wildcards.

acrodrigues03
Partner - Contributor III
Partner - Contributor III
Author

Thank you! That helps to hide the country fields, but than I still don't know how can I restrict every country field from every table. 

 

I thought about doing something like:

 

Section Access;
LOAD
"ACCESS",
"USERID",
UPPER("COUNTRY CODE") as "COUNTRY",
UPPER("COUNTRY CODE") as "COUNTRY 2",

...
FROM [lib://...\SECTION_ACCESS.qvd]
(qvd);

 

But when I add more than 1 field to restrict, I loose access to the application. 

Or
MVP
MVP

I have no idea if this can be achieved without some sort of bridge table. Not something I've ever tried to do..

Have a look at this, it may help:

https://community.qlik.com/t5/Qlik-Sense-App-Development/Section-Access-On-Multiple-Tables-with-diff...