Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Default max date selection

Hi All,

Here I have a scenario where I'm retrieving date field as 42060, 42081 number format, i converted this to proper date format as 04-Mar in list box (as per my requirement), here I need to show default maximum date when the documents gets opened.

Regards,

krishna

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

Trigger select in field Day-Month with in value field:

=Max(Num#([Day-Month]))

MaxValue.png

View solution in original post

9 Replies
JonnyPoole
Former Employee
Former Employee

you can add an 'open document'  trigger with a 'select in field' action and pass in the following expression:

=date(max( {1} Date))

where 'Date' is your Date field.

The  trigger is done at Settings -> Document Properties -> Triggers.

alex_millan
Creator III
Creator III

Hi Krishna,

you can set a trigger on the document.

Settings --> Document Properties --> Triggers --> On open --> Select in Field

On field put your desired date field name

On search string put Max([your desired date field name)

Hope that helps.

Regards.

stigchel
Partner - Master
Partner - Master

You can use a trigger when opening the document (Settings\Doc properties\triggers\Document triggers\OnOpen or use e.g. a start button with trigger). Use a Select in Field trigger with your date field and an expression in the value expression like:

=Date(Max(YourDateField),'DD-MMM')

Not applicable
Author

Hi Alex & Jonathan poole,

Thnx for the reply...I tried both before ..but its not working..let me put this in detail..my date field is [Day-Month] with following values 42054,42055,42060. here I converted this stuff to 24-feb using  =Date(PurgeChar([Day-Month],'[]'),'DD-MMM') in my list box. Now when I'm trying to show the default max date values its not working. In the trigger I tried max(my field name) n also max(=Date(PurgeChar([Day-Month],'[]'),'DD-MMM') ..but no use.

The same thing is working fine when I try it in the text object...not sure why its behaving this way...

Regards

Krishna

JonnyPoole
Former Employee
Former Employee

Piet's post above was my next guess.. so maybe you can post your QVW with some sample data in it next ?

Not applicable
Author

Hi All,

Please find attached qvw file .. !

Regards,

Krishna

stigchel
Partner - Master
Partner - Master

Trigger select in field Day-Month with in value field:

=Max(Num#([Day-Month]))

MaxValue.png

JonnyPoole
Former Employee
Former Employee

i'd suggest fixing your date load in the load script .  otherwise the trigger needs to invoke the same purgechar() expression. 

Here is a working example of the select in field action WITHOUT fixing the load script:

max( {1} PurgeChar([Day-Month],'[]'))

Not applicable
Author

Thnx Piet, Its working now, I tried the same thing before but don't know why it didn't worked...

Regards

Krishna