Skip to main content
Announcements
Get Ready. A New Qlik Learning Experience is Coming February 17! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Static Filter On Open Document

Hello,

I tried the search function, but sadly I did not find clear answers for me as a beginner.

So thanks in advance for your help and patience.

I have to add various static filter values in a multi sheet document basing on the user ID (OSuser( )).

Static filters shall be applied, when the user opens the QV document.

The user must be able to apply his own filter values within the static filter range.

Example: Static filter range on country is: UK, US, DE and user can apply a filter on US only if he wants

I found "= OSuser( ) " which returns the user ID, works fine, but my questions are

1.What is the correct syntax to set the static filter for above example?

2.What is the right place for the code? (Where is in QV an OnOpenTrigger on document level?)

3.How can it be prevented, that the filter is removed with the menu option "Clear"?

Kind regards

6 Replies
marcus_sommer

I think what you need is section access in your applications. All other things like locking fields, linking objects on osuser(), using trigger could be useful for layout and usability but do not really prevent user for access data - see here and read it carefully:  Introduction to Section Access

- Marcus

Not applicable
Author

Thanks a lot for your answer, Marcus.

Is there any alternative (with less effort) to do this?

I hoped to get an answer like

Go to Trigger OnOpenForm():

Enter:

If USERID = 'A' then

  set gloablfilter 'B'  on field 'C'

Brgds

marcus_sommer

Within the document properties are a tab trigger. Here you could define an OnOpen-Trigger (sometimes OnOpen don't work and need a workaround like open within a landing page and using from an ActiveSheet-Trigger) which select/locked various fields and if you want on a user-level, too.

But if you have many fields and/or users this will be a lot of work, too. And it won't prevent advanced user to access other data as you want - unless you used section access. You will need it often in the future, so the current time invest will be repaid.

- Marcus

IAMDV
Luminary Alumni
Luminary Alumni

I strongly recommend using SECTION ACCESS as mentioned by Marcus.

However, if you wanted a shortcut then you can create a bookmark and assign this book on "OnOpen" event under Document Properties. You can also update/replace the bookmark and it's easy to manage compared to individual field selections.

I hope this helps!

Cheers,

DV

www.QlikShare.com

Not applicable
Author

Great, Marcus, I will try your described procedure tomorrow.(Understanding that this is not the recommended & professional way, but helps for top urgent requirements)

Thank you, Deepak, for your opinion. I fully agree.

Concerning the Bookmarks: I really like the bookmarks and I have implemented them already for one project. Very smart solution in QlikView!

Thanks again & Brgds

Not applicable
Author

Today I got a hint to use the option of data reduction in the QlikView management console.

This allows to publish a QV document with a static filter (reduced data load) without extra effort in development, only one time effort to setup additional job in the QV management console.

Start QV Management Console -> Documents -> Select your source document -> Select "Add Task" (right side) -> Use Wizzard -> Select Option "Yes, distribute only parts of the document -> follow the Wizzard

Thanks QlikView, you are a very smart tool!