Page 1 of 1

Writing the current month of the last observation in graphs

Posted: Tue Jan 15, 2013 4:09 am
by econanalyst
Dear all,

I am quite new with EViews programming language and I have a problems in writing the current MONTH of the last non missing value in a series in its graph. I have tried the following code:

string last= @otod(@ilast(X)) comment: This reads the date of the last non missing value in X

!current month=@otod(@ilast(X)) comment: I know this is not working and I understand what is the problem, I cannot figure out how to solve it.

graph_{%i}.addtext cu. mo.: !cu_month comment: this is the final step. This part of the code is working fine by reading the date from an excel sheet and setting !cu_month=datepart(@elem(Y,V), "mm")
where Y is the series that contains the current excel date.

Take into account that all this goes in a relative big code that is producing around 2000 graphs.
Suggestions?

Thanks for you help!

Re: Writing the current month of the last observation in gra

Posted: Tue Jan 15, 2013 8:48 am
by EViews Gareth
Something like:

Code: Select all

%text = "cu. mo.: " + @datestr(@dateval(@otod(@ilast(x))), "MM") graph_{%i}.addtext {%text}

Re: Writing the current month of the last observation in gra

Posted: Wed Jan 16, 2013 12:42 am
by econanalyst
Thanks a lot!