Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am loading dates from a qvd file and am looking to create a date offset. in other words, if "[Real Date]" is 8/6/2012, i want [Offset Date] to be three days before [Real Date]. i have tried date(only([Real Date])-3) but that will always give me 3 calendar days before (8/3/2012 in my example). i am looking to show only 3 [Real Date]'s ago, to account for weekends and days not othewise loaded as [Real Dates]. a better example might be [Real Date]=7/5/2012. my current expression will give me 7/2/2012, however, due to a weekend and no activity on 7/4, the day i am looking for is 6/29/2012.
Peek([Real Date], RowNo()-4) as [Offset Date]
Just be careful with the edges, where no value is there 3 rows before.
You could use Peek function to achieve that assuming that not real dates are not in your database.
Thank you Ioannis. so would my script look something like
date(peek([Real Date])-3 as [Offset Date]?
Peek([Real Date], RowNo()-4) as [Offset Date]
Just be careful with the edges, where no value is there 3 rows before.
Great. thank you