Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
clarcombe
Contributor III
Contributor III

Create a default selection for a sheet.

Hello,

I have been experimenting with setting a default date for a pivot table using the following variable

=IF(GetSelectedCount(TDB_DT)>0,TDB_DT,Max(TDB_DT))

When the sheet opens, the KPI field shows the latest date, but the actual selection shown is the full range of the data.

I cannot use a bookmark as the date is incremented daily.

How can I set the actual date selection to the Max(TDB_DT) on opening the sheet.

Thanks
1 Solution

Accepted Solutions
clarcombe
Contributor III
Contributor III
Author

 MaxDPTDBDT.JPG

 

I set the start and end date to the max of group 1 and changed the KPI to simply TDB_DT.  This works whenever I change sheets now

If this was what suggested above and I didn't understand it, then kudos to them!!

View solution in original post

8 Replies
rbartley
Specialist II
Specialist II

Hi,

 

Doesn't it work if you add an Action to the sheet where the action is "Select values matching search criteria", the field is the field you are interested in (TDB_DT) and the Value is =Max(TDB_DT)?  It works in my app (FILTER_YEAR field used). See below: 

Community_Sheet_Filter.PNG

 

stevejoyce
Specialist II
Specialist II

You can set field selections in bookmarks to be dynamic (based on calculation).  If you search in your filter object like = max({1} TDB_DT = max({1} total TDB_DT), that should update your next day when a new TDB_DT loads in.

clarcombe
Contributor III
Contributor III
Author

MaxTDBDT.JPGUnfortunately not, even though the date is showed in the KPI, the full sum of the entire database is being shown in the totals. The first column total should just be 901 not 23283

clarcombe
Contributor III
Contributor III
Author

FilterTDBDT.JPG

so I added a filter pane and put this expression in, = max({1} TDB_DT) = max({1} total TDB_DT) but it said it was an invalid dimension?

clarcombe
Contributor III
Contributor III
Author

I also have a single-date date picker. Is there anyway I can set this selection to a default of the latest date ? Would this be easier

luis_pimentel
Partner - Creator III
Partner - Creator III

You can enter that expression in the search box of the TDB_DT listbox (or in the Advanced Search) and then create the bookmark. The search string isn't saved in the bookmark, but the selection that is the result of the search string is. Then set this bookmark as default for the app.

clarcombe
Contributor III
Contributor III
Author

 MaxDPTDBDT.JPG

 

I set the start and end date to the max of group 1 and changed the KPI to simply TDB_DT.  This works whenever I change sheets now

If this was what suggested above and I didn't understand it, then kudos to them!!

stevejoyce
Specialist II
Specialist II

@luis_pimentel  it's actually the search sting that's saved in the bookmark. it will apply the selection for the result of the search string, but if you do getfieldselection or data changes, the bookmark is the search string.