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: 
jameswills
Contributor III
Contributor III

Button trigger to set select dates in next week

HI All,

I'm after some help from the experts with an expression syntax please.

I have a date field, 'Next_Review_Date' in format DD/MMM/YYYY. I'd like an easy solution, button if possible, to select all values where the date is greater than today but less than 7 days from now. Really appreciate if someone could help with the syntax and how to apply please.

15 Replies
OmarBenSalem

in your action button:

='>' & Date(Today(),'DD/MM/YYYY') & '<=' & Date(Today()+7,'DD/MM/YYYY')


in your script:

change your Next_Review_Date field to:

date(Next_Review_Date) as Next_Review_Date

or date(date#(Next_Review_Date)) as Next_Review_Date

jameswills
Contributor III
Contributor III
Author

HI Mark,

Lots of fun!!

The date format in the file and as set in the load is definitely DD/MM/YYYY. I've added the

DATE(DATE#(Next_Review_Date,'DD/MMM/YYYY'),'DD/MM/YYYY') as 'Next_Review_Date',

and reloaded but this makes all my dates in both the table and list box disappear (replaced by '-').

OmarBenSalem

maybe

DATE(DATE#(Next_Review_Date,'DD/MMYYYY'),'DD/MMM/YYYY') as 'Next_Review_Date',

jameswills
Contributor III
Contributor III
Author

Hi Omar,

Have changed the button syntax and used

date(Next_Review_Date) as Next_Review_Date

in the load, button action still does nothing.

changed load to

date(date#(Next_Review_Date)) as Next_Review_Date

this removes the date all together.

I've attached the qvw for info, might be easier to look at it first hand.

jameswills
Contributor III
Contributor III
Author

This just wipes all the dates out

I've attached a copy of the qvw above, hoping this might help?

jameswills
Contributor III
Contributor III
Author

Just spotted an error in the data

The syntax from Omar and Mark works a treat when you actually correct the source data!!!!