Hello All.
I'm trying to create a simple year-to-date (ytd) % change calculation i.e. genr seriesXytd = seriesX/seriesX(-ytd)
how can I reliably obtain a value for the "ytd" variable?
i've tried creating a scalar value a al
smpl 31/12/2009 25/10/2010
fetch(d=database) seriesX
scalar ytd = @obs(seriesX)
but unfortunately because i use many series (whose last data point may or may not be today's date) one scalar value use for all ytd calculations is incorrect
Many thanks in advance for any help
Wes
Last Data Point of the Year
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Last Data Point of the Year
I'm not sure I follow what this ytd value you're trying to capture is.
The number of observations a particular series has in this calendar year?
The number of days since January 1st 2010?
The total number of observations a particular series has (which is what you seem to be indicating by the @obs function)?
The number of observations a particular series has in this calendar year?
The number of days since January 1st 2010?
The total number of observations a particular series has (which is what you seem to be indicating by the @obs function)?
Re: Last Data Point of the Year
Hi Gareth & thanks for the reply.
the ytd value is the % change in a series since the begining of the year - thus i need to divide the latest value of a series by last value in the preceeding calandar year (today's oct 26th for example, so i would take the value today / by the value on Dec 31,2009
I was using the @obs function, but that lead to some problems due to some indiscrepencies with the data i'm using - however I may have a solution using the @elem function to specify the dates i want for each series...
thanks for the tip.
Wes
the ytd value is the % change in a series since the begining of the year - thus i need to divide the latest value of a series by last value in the preceeding calandar year (today's oct 26th for example, so i would take the value today / by the value on Dec 31,2009
I was using the @obs function, but that lead to some problems due to some indiscrepencies with the data i'm using - however I may have a solution using the @elem function to specify the dates i want for each series...
thanks for the tip.
Wes
Who is online
Users browsing this forum: No registered users and 2 guests
