Text object question

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

helpmecodeplease
Posts: 7
Joined: Wed Oct 04, 2023 8:30 am

Text object question

Postby helpmecodeplease » Fri Oct 31, 2025 10:53 am

Can you make a text object that combines text and the last observation of a series? Eg. the text object created in a program would say, 'the price of oil was" {then the last observation of the oil series] in [then the month of the last observation]

Thanks

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

Re: Text object question

Postby EViews Gareth » Fri Oct 31, 2025 11:33 am

Code: Select all

wfcreate m 1990 2020 series oil = @nrnd smpl @last-4 @last oil = na smpl @all text mytxt %val = @str(@last(oil)) %last = oil.@last %msg = "The last price of oil was: " + %val + " in " + %last mytxt.append {%msg} show mytxt

helpmecodeplease
Posts: 7
Joined: Wed Oct 04, 2023 8:30 am

Re: Text object question

Postby helpmecodeplease » Fri Oct 31, 2025 11:41 am

Awesome, thanks Gareth. What if I want it to give me a different observation? Say that observation in the month that a different series had its last observation. So I want to talk about about variable1 which goes to 2025m10 but refer to variable1's observation in the last month of variable2's series?

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

Re: Text object question

Postby EViews Gareth » Fri Oct 31, 2025 1:59 pm



Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests