Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
maxim1500
Partner - Creator
Partner - Creator

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
maxim1500
Partner - Creator
Partner - Creator
Author

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?

amarti
Partner - Contributor III
Partner - Contributor III

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

novikov_mdm
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?

 

 

amarti
Partner - Contributor III
Partner - Contributor III

Hi,

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

Alessandro