String dates: the last day of x-quarters ahead

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

tvonbrasch
Posts: 394
Joined: Fri Apr 15, 2011 5:35 am

String dates: the last day of x-quarters ahead

Postby tvonbrasch » Sun Mar 17, 2019 12:29 am

Hi

How can i get the string date for the last day of x-quarters ahead, i.e. when

x=1: I want the string: "30/06/2019" (the last day of the second quarter, i.e x= 1 quarter ahead)
x=2: I want the string: "30/09/2019" (the last day of the third quarter, i.e. x= 2 quarters ahead)

etc...

Thomas

EViews Matt
EViews Developer
Posts: 369
Joined: Thu Apr 25, 2013 7:48 pm

Re: String dates: the last day of x-quarters ahead

Postby EViews Matt » Sun Mar 17, 2019 11:03 am

Hello,

I believe that would be: @datestr(@dateceil(@dateadd(@date, x, "Q"), "Q"))

tvonbrasch
Posts: 394
Joined: Fri Apr 15, 2011 5:35 am

Re: String dates: the last day of x-quarters ahead

Postby tvonbrasch » Mon Mar 18, 2019 9:07 am

great, thanks!
Thomas


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 3 guests