Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Don't miss the upcoming Q&A with Qlik session on Qlik Application Automation on November 16th! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
waleeed_mahmood
Creator
Creator

Section Access on Two Fields

Hi all,

I have two tables. One is a regional level table and other is a rep level table. So basically, the regional level table has no rep data to it at all. But the rep level table has region assigned to each row.

now i have two sheets in my app, one that shows regional numbers and one sheet that shows rep level numbers.

what i want is the following:

if a rep logs in the app:

1. in the rep sheet, he only sees his numbers.

2. in the regional sheet, he sees his entire region.

so if Rep A belong to Eastern Canada, he should only see Eastern Canada's regional numbers as well as Rep A's numbers.

How can i achieve this with section access? 

@Henric_Cronström if you be so kind to suggest something, i'd really appreciate it.

Labels (3)
2 Replies
Henric_Cronström

If you have two tables, one with rep data and one with region data, this should work straight away.

Henric_Cronström_0-1593523219792.png

 

Just create a Section access with Rep as reducing field, and you will get exactly what you want.

Note that you will then calculate the Region sales from the region table. You cannot use the [Rep Sales] field and accumulate this to region level.

HIC

 

waleeed_mahmood
Creator
Creator
Author

Hello HIC,

Thank you for your input.

I am unable to get both views working at the same time. I have the following data model:

waleeed_mahmood_0-1593536603325.png

I have a few fields that are similar between the Rep Table(RepActuals) and the Regional Table (FINAL) so naturally i have a synthetic key. Then i have the following in my section access script :

SECTION ACCESS;
[ACCESSTABLE]:
LOAD
    "ACCESS",//USER or ADMIN
    "USERID",//AD001\SALINK
    SALINK//this reduction field is the userID of a Rep
FROM ....
SECTION APPLICATION;
[LINKTABLE]:
LOAD
    SALINK,
    GID //this field exists in the Rep Actual Table and is the ID of a Rep 
FROM....

But in this way, i only see the numbers at Rep level and not at Regional level. Could you point out as where i might be going wrong at this?

Thank you.