Hi all,
I'm attempting to assign various attribute fields to several series in a data job.
I can successfully import the attribute fields into my workfile as series using this command:
pageload(page=attributes) c:\warem32\cdb_attr.xlsx range="annual!b1:mw20" byrow colhead=0 names=("name", Geography, concept, Product, Unit, "Bank Name(s)", Mnemonic, "Base Period", "Data Edge", "End Date", "Last Update", "Long Label", Real/Nominal, Scale, "Seasonal Adjustmnet", "Series Type", "Short Label", Source, "Start Date", Frequency)
However, when I try to store the attributes in the desired data objects within the same workfile (while overwriting existing attributes) nothing happens.
I am using these commands:
pageselect annual '(the page in which the data objects exist)
importattr(o) attributes @keep all '(I've tried to import just one attribute as well, and still, nothing happens).
Any thoughts on why this code wouldn't work, or if I'm missing something? I've attached the workfile for reference.
Thanks,
Bob
importattr command
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- EViews Developer
- Posts: 790
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: importattr command
I downloaded your workfile, switched to the annual page, then ran the following command in the command window:
and when I checked a series on the annual page, it had all the attributes:
Is this what you're looking for?
By the way, IMPORT & WFOPEN commands can both read various different columns of your data as attributes instead of series so you can import everything in a single step. This was introduced in EViews 10. Look at the "colheadnames" argument in the WFOPEN help page, or look at this short video about the process on our EViews 10 Whats New page.
Steve
Code: Select all
importattr(o) attributes
and when I checked a series on the annual page, it had all the attributes:
Is this what you're looking for?
By the way, IMPORT & WFOPEN commands can both read various different columns of your data as attributes instead of series so you can import everything in a single step. This was introduced in EViews 10. Look at the "colheadnames" argument in the WFOPEN help page, or look at this short video about the process on our EViews 10 Whats New page.
Steve
Re: importattr command
Thanks, Steve.
I'm running the same command and it's not working...I've using eviews 10 (I've tried it in both 32 and 64 bit versions). Is there something I'm missing?
Thanks,
Bob
I'm running the same command and it's not working...I've using eviews 10 (I've tried it in both 32 and 64 bit versions). Is there something I'm missing?
Thanks,
Bob
-
- EViews Developer
- Posts: 790
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: importattr command
If you haven't updated to the latest patch, please do so and try again.
Otherwise, I'm not sure why you're seeing different behavior. Did you manually run the commands via the command window or did you run the program again?
Otherwise, I'm not sure why you're seeing different behavior. Did you manually run the commands via the command window or did you run the program again?
Re: importattr command
That worked! Could you instruct me on how to remove the already existing "description" attribute from each series?
Thanks again!
Bob
Thanks again!
Bob
-
- EViews Developer
- Posts: 790
- Joined: Tue Sep 16, 2008 3:00 pm
- Location: Irvine, CA
Re: importattr command
You responded so quickly, I'm curious -- what did you do differently that made it work?
I thought the import's overwrite mode would overwrite any previous description. Is that not working as expected? Oh, you're not writing to the description value...
Well if you want to clear or set all description values for all objects on your page, you can do something like this:
or if you want to set it to a specific value:
Here's the help page for label property.
Steve
I thought the import's overwrite mode would overwrite any previous description. Is that not working as expected? Oh, you're not writing to the description value...
Well if you want to clear or set all description values for all objects on your page, you can do something like this:
Code: Select all
%names = @wlookup("*")
for %name {%names}
{%name}.label(d)
next
or if you want to set it to a specific value:
Code: Select all
%names = @wlookup("*")
for %name {%names}
{%name}.label(d) "new value"
next
Here's the help page for label property.
Steve
Re: importattr command
Thank you very much, Steve.
I wasn't viewing the series correctly to see the label. Once I changed that, it worked.
Do you know if there is a way to select just one attribute out of many to be cleared, for each series (using a similar loop as you described above)?
Thanks,
Bob
I wasn't viewing the series correctly to see the label. Once I changed that, it worked.
Do you know if there is a way to select just one attribute out of many to be cleared, for each series (using a similar loop as you described above)?
Thanks,
Bob
Re: importattr command
Sorry for the false alarm. I figured out a workaround by clearing all labels before importing the new ones. And there was some confusion on my end as I didn't realize "description" was an existing field for labels/attributes. I had imported an attribute field titled attribute, without knowing it was part of Eviews existing syntax.
Thanks again!
Bob
Thanks again!
Bob
Who is online
Users browsing this forum: EViews Steve and 27 guests