Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
rglenn0780
Contributor II

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,

Tags (1)
10 Replies
OmarBenSalem
Esteemed Contributor

Re: Coding expressions for Qlik Sense Objects by User Access?

Can you be specific?

Khan_Mohammed
Honored Contributor II

Re: Coding expressions for Qlik Sense Objects by User Access?

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.

rglenn0780
Contributor II

Re: Coding expressions for Qlik Sense Objects by User Access?

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
Esteemed Contributor

Re: Coding expressions for Qlik Sense Objects by User Access?

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
Esteemed Contributor

Re: Coding expressions for Qlik Sense Objects by User Access?

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?

rglenn0780
Contributor II

Re: Coding expressions for Qlik Sense Objects by User Access?

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.

rglenn0780
Contributor II

Re: Coding expressions for Qlik Sense Objects by User Access?

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

OmarBenSalem
Esteemed Contributor

Re: Coding expressions for Qlik Sense Objects by User Access?

Did it do the trick?

rglenn0780
Contributor II

Re: Coding expressions for Qlik Sense Objects by User Access?

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

Community Browser