Page 1 of 1
Tables that contain series that sometimes aren't populated
Posted: Thu Dec 06, 2018 7:38 am
by miorinnovo
I have a table in my program that displays a number of series. These series only get created if certain conditions are met. So I'm wondering if , when those conditions are not met, and the series is not created, can i somehow still have the table show up with an NA rather than the message I currently get which says "series is not defined."
Hope this makes sense, and thanks.
Re: Tables that contain series that sometimes aren't populated
Posted: Thu Dec 06, 2018 7:46 am
by startz
One option--might or might not meet your needs--is to create the series and set them equal to NA. Then your code can populate them with real values or just leave them alone.
Re: Tables that contain series that sometimes aren't populated
Posted: Thu Dec 06, 2018 8:16 am
by miorinnovo
Thanks, That would create a second problem though because another formula is dependent on how many series get populated.
Re: Tables that contain series that sometimes aren't populated
Posted: Thu Dec 06, 2018 8:28 am
by EViews Gareth
Tables are entirely under your control. If you want to set an element of a table equal to NA, then do it.
In other words, I am not really sure what the issue is.
Re: Tables that contain series that sometimes aren't populated
Posted: Thu Dec 06, 2018 8:35 am
by miorinnovo
The issue is I would rather not have to comment out and uncomment lines of tables all the time. I would like the table code to stay as it is whether all series are populated or only some are populated.
Re: Tables that contain series that sometimes aren't populated
Posted: Thu Dec 06, 2018 8:46 am
by EViews Gareth
The EViews programming language supports if statements. You can have your code do things or not do things based upon conditions. If there are lines of code that you don't want to occur if a condition is not met, use an if condition.
Re: Tables that contain series that sometimes aren't populated
Posted: Thu Dec 06, 2018 9:02 am
by miorinnovo
Right, this is what I had in mind but I'm not sure how to code an if statement for whether a series exists.
Re: Tables that contain series that sometimes aren't populated
Posted: Thu Dec 06, 2018 9:12 am
by EViews Gareth
Code: Select all
if @isobject("seriesname") then
else
endif
Re: Tables that contain series that sometimes aren't populated
Posted: Thu Dec 06, 2018 9:45 am
by miorinnovo
Amazing!
Thanks