Page 1 of 1

sample question - using series info

Posted: Wed Dec 12, 2018 10:03 am
by miorinnovo
Hi

If I want to have a sample of the last 6 months of my workbook I can use the code:
sample sample1 @last-6 @last

Is there a way to do this with the last date of a series rather than the last date in the workbook?

Thanks!

Re: sample question - using series info

Posted: Wed Dec 12, 2018 10:22 am
by EViews Gareth

Code: Select all

%lastdate = @otod(@ilast(y)-6) smpl {%lastdate} @last
Where y is the series.

Re: sample question - using series info

Posted: Wed Dec 12, 2018 11:49 am
by miorinnovo
Thanks Gareth.

I was looking to use the last date of the sample as the last date in my series. I was able to easily adjust your example to get that though, so for future readers looking how to do this:

Code: Select all

%lastdate = @otod(@ilast(CANADAALLSTARTS)) smpl {%lastdate}-5 {%lastdate}

Re: sample question - using series info

Posted: Wed Dec 12, 2018 11:51 am
by EViews Gareth
That first line could be simplified as:

Code: Select all

%lastdate = CANADAALLSTARTS.@last

Re: sample question - using series info

Posted: Wed Dec 12, 2018 12:05 pm
by miorinnovo
nice