Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
razvan_brais
Creator III
Creator III

Set default max Date on open application and on clear all action

Hy guys , I would like to set as Default selection my max(Date) when I open the app and when I hit the clear all button.

I have added 3 actions on my sheet properties:

1. Clear All

2.Select in Field

  a.FIELD : Date

  b. SearchString : =max(Date)

3.Lock Field

  a. FIELD : Date

But when I hit the clear all button , it clears all the selections.

When I hit the clear all button I would like to select max(Date). How can I do that?

Thank you.

1 Solution

Accepted Solutions
razvan_brais
Creator III
Creator III
Author

Hey,

I solved the issue. First action that I set on button is Clear All , and the I added a new action for "select in field"

With Date as Field and expression : =max({1} Date ) as "Search String"

View solution in original post

16 Replies
sushil353
Master II
Master II

if you want to select only one month in your listbox then use always one selected option,,

Anil_Babu_Samineni

One option you can do always select one value from list box. Please check that after open the trigger actions

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
jonathandienst
Partner - Champion III
Partner - Champion III

I think the order of execution of actions is not guarranteed. Rather than doing this via an action, define a globally evaluated variable (ie with a leading = sign), like this:

     Set vMaxDate = =Max(Date);

Now use this date in set expressions, something like this:

     Sum({<Date = {'$(=vMaxDate)'}>} Amount)

Now you need no action. If the use makes no selection, you will see data for the most recent date. If the user selects something which changes the max date, then the vMaxDate value changes and you see data for the new maximum possible date.

PS: - if you make selections on other fields in your calendar, such as Month, Week or Year, you may need to override those for this to work correctly:

     Sum({<Date = {'$(=vMaxDate)'}, Month, Week, Year>} Amount)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
razvan_brais
Creator III
Creator III
Author

That is not ok , because my value for the listbox is an expression. I also have a date object.

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

If want to select alwaymax date when you open application, put a trigger in document settings Like below.

Triggar max Date.PNGTriggar max Date when opens an app.PNG

i hope this may heps you.

-Nagarjun

razvan_brais
Creator III
Creator III
Author

But what is the behavior when I hit the clear all button?

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

in the application select always one in the date field.

-Nagajuna

razvan_brais
Creator III
Creator III
Author

I can`t do that , because my list box has an expression as a field.

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Select always one.PNG