Creating string of date of last observation minus 1

For requesting general information about EViews, sharing your own tips and tricks, and information on EViews training or guides.

Moderators: EViews Gareth, EViews Moderator

zsaijid
Posts: 3
Joined: Tue May 08, 2018 6:58 am

Creating string of date of last observation minus 1

Postby zsaijid » Mon Jun 03, 2019 11:10 am

Hello,

What is the easiest way to return date of last observation minus 1. (i.e. if my data series goes through 2019m4, i want 2019m3)

Thanks

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13305
Joined: Tue Sep 16, 2008 5:38 pm

Re: Creating string of date of last observation minus 1

Postby EViews Gareth » Mon Jun 03, 2019 11:28 am

Penultimate observation of workfile, or penultimate non-NA value of a particular series, or last non-NA value of a particular series minus one observation?
Follow us on Twitter @IHSEViews

zsaijid
Posts: 3
Joined: Tue May 08, 2018 6:58 am

Re: Creating string of date of last observation minus 1

Postby zsaijid » Mon Jun 03, 2019 11:57 am

The penultimate observation of a data series, but the date value. So if {%x}.@last gives you last date of that series and I want the prenultimate date.

zsaijid
Posts: 3
Joined: Tue May 08, 2018 6:58 am

Re: Creating string of date of last observation minus 1

Postby zsaijid » Mon Jun 03, 2019 11:58 am

Doesn't matter if the prenultimate value is NA

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13305
Joined: Tue Sep 16, 2008 5:38 pm

Re: Creating string of date of last observation minus 1

Postby EViews Gareth » Mon Jun 03, 2019 12:57 pm

Code: Select all

@otod(@ilast(x)-1)

where X is the series.
Follow us on Twitter @IHSEViews


Return to “General Information and Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 11 guests