Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Michaelb93
Contributor
Contributor

Setting a default filter with vizlib

Hello, 

I am attempting to force a vizlib filter in my  dashboard to default to a certain value. I have two columns, one of which shows all the months YTD, and one of which just shows the latest month. I would like table to be filtered to show only those rows where Month = Latest_Month upon opening the sheet or clearing any existing Month filter. 

Any help with this would be much appreciated.

Labels (2)
6 Replies
trdandamudi
Master II
Master II

You can use an extension or you can use a book mark (I usually use bookmark). Below is the extract from the help menu:

Set a default bookmark

Do the following:

  1. Click > in the toolbar of a sheet. The Bookmarks window opens.
  2. Right-click an existing bookmark, and then click Set selections as app default. An icon is added beside the bookmark indicating that the bookmark is the app default.

  3. Click the bookmark. The Bookmarks window closes. The bookmark is shown in the top toolbar, and the selections are shown in the app.
  4. To test that the default bookmark is working properly, close and then reopen the app. The default bookmark and selections should be shown when you open a sheet.

To remove a bookmark as the default, open the Bookmarks window in an unpublished app, and then right-click the default bookmark. Click Remove selections as app default.

 

Hope this helps.

Michaelb93
Contributor
Contributor
Author

Hi Trdandamudi, 

While this answer does technically solve my problem, I was hoping to avoid hard coding the filter. Ideally, as I pull in data for a new month, the "latest month" column will update, which would ideally update the vizlib filter default selection as well.

We use the vizlib extension in our production environment, so there's no reason for me to avoid it.

Best, 

Michael

dwforest
Specialist II
Specialist II

You can set the bookmark to be dynamic.

Rather than selecting a value, type in a search filter on your month, something like

=Month=<Month(Today())-1)

Then create a bookmark, it will re-evaluate the formula

mahaveerbiraj
Creator II
Creator II

Hi ,

I hope this can be done by using  GetSelectedCount() function in Qliksense

Could you please attach screenshot and expression you are  using ,

and please explain more about requirement .

Pau1
Contributor
Contributor

In a Vizlib filter properties:
Interactivity > Default Selections.

You can enter a formula in the dimension values  field and set "Set Default on Open"

Ksrinivasan
Specialist
Specialist

hi, create variable to get max date or max month

vMaxdate= max(Date_01)

and use it in chart expression:

Sum({$<Date_01 = {'$(=vMaxdate)'}>} [QTY])

it will always show Max month or Max date chart while open APP.

regards,

Ksrinivasan.