Qlik Community

Qlik Sense App Development

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

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
gsethuraman21
New Contributor

Regarding Section Access ,i need to get the user ID who is login to Qlik sense application

Section Access;
LOAD * Inline
[ACCESS,USERID,PERSON_IDENTIFIER,REPORTS_TO
ADMIN,TAG\T234GC,432555,63225
ADMIN,TAG\T564GS,1761528,432555
ADMIN,TAG\T0386HC,932143,63225
ADMIN,INTERNAL\SA_SCHEDULER,13212];

I need to get who is login to the Qlik sense Application so i can get that variable value i and parse to subsequent queries to generate the Charts ..

Section Application;

// LET vSA1 = UPPER(peek('PERSON_IDENTIFIER',0,'SECTION_ACCESS_FIELDNAME'));

LET vSA1 = UPPER(peek('PERSON_IDENTIFIER'));   //(But by default iam getting 13212 sa scheduler value )

 

For example if  this person logs in TAG\T234GC , i need 432555 in variable (vSA1 =432555)

 

For example  if this logs in TAG\T564GS,i need  in  1761528 (vSA1 =1761528)

4 Replies
Partner
Partner

Re: Regarding Section Access ,i need to get the user ID who is login to Qlik sense application

You can not set the vSA1 variable during the script execution as the data reduction is performed as the user opens the application.

I assume you have a field in your application called PERSON_IDENTIFIER and that each USERID is only connected to one PERSON_IDENTIFIER in the Section access table. Then you could during the script execution declare the vSA1 as this.

SET vSA1 = Only(PERSON_IDENTIFIER)

Right after an reload your variable will return NULL as you have more than one PERSON_IDENTIFIER, but when the data is reduced by an user opening the application the variable will have the right single value.

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
gsethuraman21
New Contributor

Re: Regarding Section Access ,i need to get the user ID who is login to Qlik sense application

So in that scenario how i parse person identifier in section application queries ..

for example how to get below value in the where clause ..

WHERE ROOT.REPORTS_TO_USER = $(vSA1)  and TJOBAT.AUTHORIZED_PERSON In $(vSA1) 

 

Becuase  --> SET vSA1 = Only(PERSON_IDENTIFIER); --> returns as string field -> Only(PERSON_IDENTIFIER) ..

Partner
Partner

Re: Regarding Section Access ,i need to get the user ID who is login to Qlik sense application

You can not use user specific queries in the script, because the script is executed and run before any user access the application. You should load the application with all data and let the Section Access do the reduction when the user opens the application.

When the user TAG\T0386HC opens the application with your above mentioned SA table it will only see the data for data associated with the field PERSONAL_ID = 932143 and REPORTS_TO = 63225.

If you think I missunderstood your last comment then please add some sample script on how your where thinking and a pic of your datamodel to help us understand your issue better.

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
gsethuraman21
New Contributor

Re: Regarding Section Access ,i need to get the user ID who is login to Qlik sense application

Thanks for the reply