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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
mwallman
Creator III
Creator III

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

Labels (1)
4 Replies
Colin-Albert
Partner - Champion
Partner - Champion

date(Transaction_Date - 320)

MK_QSL
MVP
MVP

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

Load

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

AutoGenerate 1

mwallman
Creator III
Creator III
Author

Thank you both you are both correct

sunny_talwar
MVP
MVP

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