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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

Date Variable

Hi,

I have a script that where I state the following:

where tl.final_pricing_dt > '2016-08-29'

Is it possible to replace the date with a variable for yesterday?

Thanks,

Daniel

6 Replies
sunny_talwar

Sure, may be like this:

LET vDate = Date(MakeDate(2016, 8, 29), 'YYYY-MM-DD');

Where tl.final_pricing_dt > '$(vDate)';

Not applicable

Hi,

vYesterday=Today()-1

Thanks,

Nitin

danielnevitt
Creator
Creator
Author

Thanks for the reply.

Will that create a moving date?  For example if I run the report tomorrow I would like the date to be today.

ie Run on 01/09/2016 and pricing greater than 31/08/2016.

Regards,

Daniel

sunny_talwar

May be this:

LET vDate = Date(Today() - 1, 'YYYY-MM-DD');

Where tl.final_pricing_dt > '$(vDate)';

Not applicable

Yes , Today() function gives you today's date every time you open or reload the qvw .

Thanks

Nitin

Chanty4u
MVP
MVP

try lik

let vdate=Date(Today()-1,'YYYY-MM-DD');

[test]:

LOAD * INLINE [

Maand, ID, myDate

1, 2, 2014-12-14

2, 3,2016-09-15

]

Where myDate>'$(vdate)';