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: 
Anonymous
Not applicable

Maximum Date For Trigger on Sheet

I have a trigger on the Sheet level to automatically default to the maximum week.  This trigger is:

='='& Max(Date(Monday_Work_Week))

Sheet Level Trigger.png

The expression appears in the Current Selection as seen above.  However, the maximum week is not selected (see image below).

I noticed that the date format is different.  The format in the Current Selection is 03-19-2018 for the Monday_Week_Work.  I date format for the Monday_Week_Work field is 2008-03-19.  Could this be why? If yes, how can I fix it.

MondayWorkWeek.png

1 Solution

Accepted Solutions
sunny_talwar

Or may be this if you want to select max irrespective of any selections

=Date(Max({1} Monday_Work_Week), 'YYYY-MM-DD')

View solution in original post

27 Replies
Anonymous
Not applicable
Author

The Monday_Work_Week is:

cast (Replace(c.StartOfWorkWeek, 'MON - ', '') as Date) as Monday_Work_Week

sunny_talwar

Try this

=Date(Max(Monday_Work_Week), 'YYYY-MM-DD')

shiveshsingh
Master
Master

=Date(max(Monday_Week_Work),'YYYY-MM-DD')

sasiparupudi1
Master III
Master III

Trigger expression

=Max(Monday_Week_Work)


or

=Date(Max(Monday_Week_Work),'MM-DD-YYYY')

sunny_talwar

Or may be this if you want to select max irrespective of any selections

=Date(Max({1} Monday_Work_Week), 'YYYY-MM-DD')

Anonymous
Not applicable
Author

I have changed the Monday_Work_Week field to have the format MM/DD/YYYY.   I tried  your code like this but it does not display anything =Date(Max({1} Monday_Work_Week), 'MM/DD/YYYY')

MOnday.png

datemax.png

sunny_talwar

Your date is not longer understood as date field by Qlik... See how it left aligned

Capture.PNG

You need to make sure that your date is read properly to make this work

Why don’t my dates work?

QlikView Date fields

Get the Dates Right

Anonymous
Not applicable
Author

This is how I got the Monday_Work_Week: 

(Replace(c.StartOfWorkWeek, 'MON - ', ''))Monday_Work_Week

I also tried convert and cast without success.

The trigger is still

=Date(Max({1} Monday_Work_Week), 'MM/DD/YYYY')

sunny_talwar

Is this something you did in QlikView script (under load) or in SQL script (under select)?