Page 1 of 1

Assigning dynamic strings

Posted: Wed Mar 11, 2015 7:55 am
by svilen
I would like to have a date string like this:
%date_1 = "2014:4"
and another one depending on former adding one quarter:
%date_2 = "2015:1"
Unfortunately %date_2 = {%date_1}+1 does not work although in: smpl %date_1 %date_2+1 it works.

How to make the second one dependant on the first one using a formula?

Re: Assigning dynamic strings

Posted: Wed Mar 11, 2015 8:40 am
by EViews Gareth
Use the @dateadd function.

The reason you can do %date+2 in a sample statement is that the sample knows the frequency of the workfile, and is able to add that number of units to a date easily. When dealing with arbitrary strings, EViews has no idea what frequency you're interested in, so has no way of adding to it.