Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date subtraction logic

HI All,

I'm trying to subtract 14 days from a date variable vCreateDate := '05-14-2015'

For this, I tried following the simple method as shown below:

LET vReloadDate = Date($(vCreateDate),'MM-DD-YYYY') - 14;

The value I receive is '06-01-1894' instead of 14 days being deleted from the vCreateDate variable. I tried using the Interval function but that does not work either.

Any suggestions will be appreciated.

Thanks!

2 Replies
sunny_talwar

Try this and see if this helps (Change in Red

LET vReloadDate = Date($(vCreateDate)-14,'MM-DD-YYYY');


Best,

Sunny

sunny_talwar

Or this if the above doesn't work:


LET vReloadDate = Date(Date#($(vCreateDate), 'MM-DD-YYYY') -14,'MM-DD-YYYY');