Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Our next Qlik Insider session will cover new key capabilities. Join us August 11th REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
meetmrudul
Creator II
Creator II

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()";

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
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

meetmrudul
Creator II
Creator II
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.

meetmrudul
Creator II
Creator II
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.