delete series in a wf based on date

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

Moderators: EViews Gareth, EViews Moderator

mboll
Posts: 6
Joined: Thu Feb 23, 2023 5:47 am

delete series in a wf based on date

Postby mboll » Thu Feb 23, 2023 2:30 pm

I have a wf with many series, some for the period 1980-2021 and some for the period 1980-2031. I would like a code that easily deletes all series that only have values for the period 1980-2021. But I don't know the best way to do that. Super thankful for tips on how to solve this.

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

Re: delete series in a wf based on date

Postby EViews Gareth » Thu Feb 23, 2023 3:50 pm

Code: Select all

%serlist = @wlookup("*", "series")
smpl 2022 @last
for %j {%serlist}
   if {%j}.@obs=0 then
      d {%j}
   endif
next
smpl @all
Follow us on Twitter @IHSEViews

mboll
Posts: 6
Joined: Thu Feb 23, 2023 5:47 am

Re: delete series in a wf based on date

Postby mboll » Fri Feb 24, 2023 1:04 am

Perfect, thanks!!


Return to “General Information and Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 10 guests