Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Default Date in Selection List

I have a Date labeled TimePeriod that I am using in a selection list.  I want the default selection to be the most recent date.

I am using this syntax and not sure what I am doing incorrect.  Any guidance would be appreciated.

Tigger

OnActivateSheet

Edit Actions

Action=>Select In Field

Field => TimePeriod

Search => =date(max("TimePeriod"))

Not working!!!

Labels (1)
9 Replies
Not applicable
Author

use this:

date(max({1}TimePeriod))

Not applicable
Author

did u try that.....??

Not applicable
Author

i did but it isnt working....

no dates are selected with the page is activated

Not applicable
Author

try putting that in the text first...and see what is the format u get.

this format shud be the same as ur date format of  the field TimePeriod.

can u post ur format here ?

Not applicable
Author

MM/DD/YYYY

Not applicable
Author

=date(max({1}TimePeriod),'MM/DD/YYYY')

sivarajs
Specialist II
Specialist II

try this macro

declare vMaxDate=max(TimePeriod)

sub test

    set x= ActiveDocument.GetField("TimePeriod")

    maxDate = ActiveDocument.Variables("vMaxDate").GetContent.String 

     x.Select maxDate

end sub

Not applicable
Author

That worked! Thank you!

Not applicable
Author

gr8....pls mark answered

Cheers!!!