Page 1 of 1

Date: current quarter

Posted: Wed Jul 06, 2016 1:50 am
by tvonbrasch
Hi

I want to generate a string with the current ended quarter.

these codes will do it:

%date=@date
genr adummy=@before(%date)
smpl if adummy<1
genr adummy= na
string aadate=adummy.@last

this gives me "2016Q2", which is what i want.

but, is there a more efficient way?

in contrast,
string aadate2=@datestr(@now-1, "yyyy:q")
yields "2016:3"

Thomas

Re: Date: current quarter

Posted: Wed Jul 06, 2016 7:44 am
by EViews Gareth

Code: Select all

=@datestr(@dateadd(@now, -1, "q"), "YYYY[Q]Q")

Re: Date: current quarter

Posted: Wed Jul 06, 2016 8:45 am
by tvonbrasch
perfect, thanks!
THomas