Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qlik User in Edit Script Where Clause

Hi All,

We are using direct discovery for one of our requirement, we found that -

Data should be filtered w.r.t. logged in user, and we can not use Section access with Direct discovery.

In the View, we have one have one column which will contain username.

Can I have the filter condition in Direct discovery as -

DIRECT QUERY

DIMENSION

  1 As Flag

MEASURE

  col1,

  col2,

  username

FROM "test_data";

where username = OSUser();

I want the workaround something like above.

Could you please assist on same.

Thanks & Regards,

MK

7 Replies
tresesco
MVP
MVP

I never tried that with direct discovery, but it looks feasible to me. Give a try and let know how it goes.

Anil_Babu_Samineni

Try Something Like this

Note: Please provide does it mandatory to show username as MEASURE. I've added this on DIMENSION Instead of MEASURE. Try Luck if this Works

DIRECT QUERY

DIMENSION

  1 As Flag,

   username

MEASURE

  col1,

  col2

FROM "test_data" where username = "OSUser()";

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

If you read this page: Limitations when using Direct Discovery ‒ Qlik Sense you will find that Section Access is available with Direct Query, but only in the Server Mode

Capture.PNG

Anonymous
Not applicable
Author

We are using QV 12 server...

I tried to implement same using direct query like -

Section Access;

DIRECT QUERY

  DIMENSION

  'USER' AS ACCESS

  MEASURE

  Upper(col1) as NTNAME,

  Upper(col1) as TEST_NAME

FROM demo;

Section Application;

I have also created a same column TEST_NAME and have checked the option of strict exclusion to True.

But its not working.

Any inputs

sunny_talwar

I am not entirely sure how exactly the direct query can be implemented, but I know the section access in direct query happens through QMC instead of doing it in the QlikView file.

Anonymous
Not applicable
Author

if that is the case, how we will run Direct query for updated users in QMC

sunny_talwar

You will need to reload the application. I think the idea for using direct query is to be updated on real time most of the time, but to update the list of users you can quickly reload it on the QMC. A direct query application reloads much faster than a regular application because it only pulls distinct values of DIMENSIONS into memory. So, you can plan to refresh this once a day when you know nobody else will be looking at this application.