Qlik Community

Qlik Sense App Development

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

Announcements
Uploads getting stuck in the virus scanner. We are investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Partner
Partner

ODAG - Filter by user

Hi,

We have a master app secured using section access. We are planning to use ODAG to generate apps to dig deeper in the data. To save on load time, would it be possible to know the authenticated user when loading the ODAG app so that we don't have to load all of the data and then filter out most of it with section access? If I was able to know who is connected, I would be able to load only the necessary data.

Thanks

4 Replies
Partner
Partner

I found that I can get the active user by using SubField(OSUser(),'=',3);

But if I execute this in the ODAG app, the user is 'sa_api'. Can I pass the user somehow from the master app to the ODAG app?

Highlighted
Partner
Partner

Hi,

you have to create a table with users list (USERID, USERNAME fields) in aggregated app which will be automatically filtered by section access. Then in the detail app, create an odag variable like :

SET USERNAME = ;
SET USERNAME = $(odso_USERNAME);
SET USERNAME_COLNAME='USERNAME';

Let vUSERNAME = Replace($(USERNAME), 'CHR(39)', '');

This variable will contain your userID value (for example: john.doe) to use as a filter in where conditions or wherever you need it.

Alessandro

Highlighted
Contributor
Contributor

Hi!

Thanks for your reply!

But I can't tranlate User_id from aggregation app to detail app.

Could you explain in more detail?

 

 

Highlighted
Partner
Partner

Hi,

what value do you get in detail app for username variable?

Alessandro