Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

mwallman
Not applicable

How do get a date 320 days before a date?

Hi all,

I have the following date field:

Date(MakeDate(2012) + Ceil(Rand() * 365)) as Transaction_Date

How can I get a date 320 days before the Transaction_Date above? This would be a new field in the script

4 Replies
colin_albert
Not applicable

Re: How do get a date 320 days before a date?

date(Transaction_Date - 320)

MK_QSL
Not applicable

Re: How do get a date 320 days before a date?

Load *, Date(Transaction_Date-320) as New_Date;

Load

Date(MakeDate(2012) + Ceil(Rand() * 365)) as Transaction_Date

AutoGenerate 1

mwallman
Not applicable

Re: How do get a date 320 days before a date?

Thank you both you are both correct

sunny_talwar
Not applicable

Re: How do get a date 320 days before a date?

If you got what you were looking for, please close the thread by marking the correct answer

Qlik Community Tip: Marking Replies as Correct or Helpful