Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
zakpullen
Creator
Creator

Restrict field values in chart using NTNAME & OSUSER

Hi,

I want to place restrictions within a chart, and keep the data in the rest of the app open.

The field to restrict by is 'Cost Centre'.

One loaded table (let's call is 'ACCESS') lists NTNAMEs in one column, and the Cost Centre they may access (for this purpose) in the second column.

Cost Centre is a dimension in the chart. I can't figure out how to restrict the Cost Centres displayed in the chart based on NTNAME in the ACCESS table. I'm assuming it will require matching NTNAME and the value returned by OSUSER().

 

Thank you.

Labels (6)
4 Replies
vishsaggi
Champion III
Champion III

You might want to use Section Access here. And list all the users you want to restrict for Cost Centre. IF you use OSUSER() how do you know which OSUSER is restricted with what cost centre. Hence, you might need to have OSUser names from your database table or from an excel sheet to handle this. Make sure you also have the Admin user list added to your excel sheet. For example:
And make sure your connecting field name is in upper case in your model.


EMPLOYEELOGIN ACCESS COSTCENTRE
AdminUsrName1 ADMIN ''
AdminUsrName2 ADMIN ''
AdminUsrName3 ADMIN ''
username1 USER CostCenterValue
username1 USER CostCenterValue
username1 USER CostCenterValue
...... add users accordingly.

Once you do this load this excel sheet in your UI qvw file like
Section Access;
LOAD EMPLOYEELOGIN as NTNAME,
ACCESS,
COSTCENTRE
FROM
excelpath\SectionAccess.xlsx;

Section Application;

Hope this helps. If not please share some sample data to work on it.
zakpullen
Creator
Creator
Author

Thanks, but wouldn't Section Access restrict data across the whole app?

vishsaggi
Champion III
Champion III

My bad I was thinking of restriction on field , you want in chart right. Still you can use this excel for that like remove section access statement and use if paused =employeelogin then costcentre something like this.
anushree1
Specialist II
Specialist II

Yes Section Access works on the complete application and not on a specific chart