Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
cwhite
Contributor
Contributor

Section Access on From and To Fields

I have a transaction data set that has a from and to country and I have a scenario where my business rules say that a user can see any transactions from a certain number of countries.

 

I have it set up where a user can see transactions from US, CANADA, MEXICO and it works great when I go against the From Country Field.   How do I also perform the data reduction against the To Country field using the same access country list?   It would great if it performed an OR when I do both columns but it is performing an AND.

 

Thanks in Advance.

 

Labels (1)
2 Replies
TauseefKhan
Creator III
Creator III

Hi @cwhite,

Qlik Sense currently does not support direct OR logic within Section Access, the solution involves creating a combined field that captures both "From Country" and "To Country" access.

// Create combined Access Country field
TransactionsWithAccess:
LOAD
TransactionID,
FromCountry,
ToCountry,
FromCountry & '-' & ToCountry AS AccessCountry,
Resident Transactions;

// Section Access configuration
Section Access;
LOAD * INLINE [
ACCESS, USERID, ACCESSCOUNTRY
ADMIN, ADMIN, *
USER, User1, US
USER, User1, CANADA
USER, User1, MEXICO
USER, User2, US
USER, User2, UK
];

// Load the data with access rules applied
Transactions:
LOAD
TransactionID,
FromCountry,
ToCountry,
AccessCountry,

Resident TransactionsWithAccess;

DROP Table TransactionsWithAccess;


**********Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.********

marksouzacosta

Hi @cwhite,

There is a great article of one of the founders of Qlik that talks exactly about your problem and how to solve it: Data Reduction Using Multiple Fields - Qlik Community - 1474917

Next, read this article: Basics for complex authorization - Qlik Community - 1465872

Be patient, the solution for your problem are there.

Learn more from this master here: A Primer on Section Access - Qlik Community - 1465766

 

Read more at Data Voyagers - datavoyagers.net