Use of import/copy and keeping descriptions

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

Moderators: EViews Gareth, EViews Moderator

MartinsFest
Posts: 27
Joined: Tue Dec 13, 2022 4:41 am

Use of import/copy and keeping descriptions

Postby MartinsFest » Fri Aug 25, 2023 4:44 am

Hello,

I have an external Excel-file, where names of the series are equivalent to some original series within my workfile. The original series contains values in the range between the years 1980-2200, while the new data contains forecasts for the period 2023-2050. I am updating the values in the original series with the values in the new file.

First question: Is there a way to do what I have done below, only using the import-command directly, within the page the original series are located? Meaning without creating a temporary page.

Second question: The values in my original series are correctly updated below. However, the copying also overwrites the original descriptions, which is unintentional. How do I keep my original descriptions?

Code: Select all

pagecreate(page="midl") q

'External data
%path = "C:\...kt2023q3-2050q4.xlsx"
import %path range=kt2023q3-2050q4!$A$2:$DG$11 byrow colhead=1 namepos=all na="#N/A" names=(,,,,,,,,,) @freq Q @id @date(series01) @smpl @all

delete series*

'Merge with original variables
ps kvarts
copy(c=none, merge) midl\* * @src @date @dest @date

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

Re: Use of import/copy and keeping descriptions

Postby EViews Gareth » Fri Aug 25, 2023 7:47 am

The import command has a mode= option that lets you do what you want.
Follow us on Twitter @IHSEViews

MartinsFest
Posts: 27
Joined: Tue Dec 13, 2022 4:41 am

Re: Use of import/copy and keeping descriptions

Postby MartinsFest » Mon Aug 28, 2023 7:44 am

Just what I was after, thank you!


Return to “General Information and Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 7 guests