Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Coming your way, the Qlik Data Revolution Virtual Summit. October 27-29. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

How to make a default selection of max date with "always one selected value"?

I need to make a default selection for the date field so that the maximum date is chosen when I open the app. I have managed to do this:

date={"=[date] = max(total [date])"}

The problem is, I want this field to have the "always one selected value" option enabled, but when I do this, a wrong date gets selected. I have tried "{1}" instead of "total" which didn't help.

Please, tell me, how should I deal with this problem? Thank you.

Labels (4)
2 Replies
Highlighted
Partner
Partner

Hi,

basically I have worked on your problem statement and able to get the working one by creating an additional column which only has a max date and linked with a Date column. this solution work whenever you have a new date in the data.

Script:

T1:
Load Date#( Date,'DD-MM-YYYY') as DATE, num#(Date) as DATE_NUM;
Load * inline [
Date
28-04-2005
02-06-2005
03-06-2005
04-06-2005
05-07-2016
15-01-2005
12-09-2005
05-09-2004
17-11-2004
29-08-2004
20-06-2004
08-10-2004
21-04-2005
11-12-2005
06-06-2004
23-06-2004
15-07-2004
27-02-2004
14-08-2004
12-03-2004
15-08-2004
04-01-2004
13-08-2004
11-03-2004
];

NoConcatenate
Load Max(DATE) as DATE_N,DATE(Max(DATE),'DD-MM-YYYY') as DATE Resident T1 Order by DATE_NUM desc ;

Front End:

one.JPGtwo.JPG

Highlighted
Contributor
Contributor

Thank you, but as far as I understand, this solution won't allow me to choose different dates, so that the max date is always chosen, right? I need to be able to let the user choose any date.