Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

Not applicable

How to get a date seven days before today's date?

Hello Everyone,

I have today's date in the format say 'YYYY-MM-DD'. I want to get the date seven days before this date.

eg. Suppose today's date is '2017-08-28'. So my requirement is to get the date value as '2017-08-21'.

What I am doing to achieve this is:

Let StartDate = Date(today(), 'YYYY-MM-DD');

Let Required_Date=($(StartDate)-7);

But this doesn't suffice my problem. Can anyone please help me out with any suggestion.

Thanks and Regards,

Arghya

1 Solution

Accepted Solutions
antoniotiman
Honored Contributor III

Re: How to get a date seven days before today's date?

Hi,

try this

Let StartDate = Date(today()-7, 'YYYY-MM-DD');

Regards,

Antonio

2 Replies
antoniotiman
Honored Contributor III

Re: How to get a date seven days before today's date?

Hi,

try this

Let StartDate = Date(today()-7, 'YYYY-MM-DD');

Regards,

Antonio

Not applicable

Re: How to get a date seven days before today's date?

Thanks Antonio.  It worked !!!!!

Community Browser