Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Coding expressions for Qlik Sense Objects by User Access?

Hello,

Is it possible to code in an object's expression (like viewing a certain product segment) based upon user access? By object, I mean scatter plot etc...

Thanks,

10 Replies
OmarBenSalem
Partner - Champion II
Partner - Champion II

Can you be specific?

MK9885
Master II
Master II

Yes, I guess you are talking about Ad-Hoc App?

The user would be given Read/Write access to the app and it's objects.

This can be further extended by defining  security rules and only give write access to particular objects.

Anonymous
Not applicable
Author

Sure,

I am coding reference lines for a scatter plot and we have segmented users based on product segment. When they login, they normally probably wont use the filter pane. So, I was wondering if I can code it a certain way to have the default (no selections made) be filtered on certain objects based on their user access?

example of a reference line expression here....so by default they have a threshold on their scatter plot at a certain point.

Thanks,

If([User]='XXXX', .5)

OmarBenSalem
Partner - Champion II
Partner - Champion II

If I fully understand you, you have list of users that have access to an app; and you want to have a certain chart, here every user, depend on its id maybe, will se only some 'regions' ?

for tthat, you have to have a table containing liste of users and their  regions, product segment to see in your case

Imagine I have this script:

load * Inline [

Region, Sales

1, 500

2, 300

3, 1000

];

load * Inline [

Region, UT

1,YourUserID

2,YourUserID

];

then , in the varaibal editor, create a new variable and call it vUT : =subField( SubField( OSUser(),';',2),'=',2)  : this will return the userID present in the QMC

and in your chart, put your dimension; and as a measure:

sum({<UT={"$(vUT)"}>}yourExpression)

result:

Capture.PNG

OmarBenSalem
Partner - Champion II
Partner - Champion II

same approach, for the threshold;

a table in the script, with each userID and its threshold:

and as threshold:

sum({<UT={"$(vUT)"}>}threshold)

hope it's clear?

Anonymous
Not applicable
Author

Thank you sir! Yes, just edit the load editor as you described and create the variable as the lead-in to the expression, which basically pre-sorts the chart.

Anonymous
Not applicable
Author

I assume I can list all the users we want in this region in the variable correct?

OmarBenSalem
Partner - Champion II
Partner - Champion II

Did it do the trick?

Anonymous
Not applicable
Author

I have to wait a bit now to try it, but will mark correct as soon as we can.