Code for searching for a row in a series object?

For questions regarding programming in the EViews programming language.

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

chester
Posts: 44
Joined: Thu May 12, 2016 11:14 am

Code for searching for a row in a series object?

Postby chester » Mon May 16, 2016 8:48 am

Is it possible to search/filter through a series (containing character data) and isolate one row? Something similar to the Filter feature in Excel or an SQL query? I'm very new to EViews and I know this must be a programmable solution. Any help is appreciated. :D

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

Re: Code for searching for a row in a series object?

Postby EViews Gareth » Mon May 16, 2016 10:01 am

What do you want to do with the result? What's the end goal?

chester
Posts: 44
Joined: Thu May 12, 2016 11:14 am

Re: Code for searching for a row in a series object?

Postby chester » Mon May 16, 2016 12:22 pm

The series data serves as a "directory" for data. Mnemonic codes are linked to their full names. I'd like users to be able to query a code and identify what it means. So the end goal is 1 row being displayed.

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

Re: Code for searching for a row in a series object?

Postby EViews Gareth » Mon May 16, 2016 12:38 pm

Not sure what you mean by "one row". One row of what? Of the series? Isn't that pointless - it will just contain the value you're looking up.

Perhaps you mean of a group?:

Code: Select all

!lookupval = 0.56 smpl if x = !lookupval show mygroup

chester
Posts: 44
Joined: Thu May 12, 2016 11:14 am

Re: Code for searching for a row in a series object?

Postby chester » Mon May 16, 2016 12:47 pm

The object in question is an alpha series. It may potentially have over 10,000 rows so I would like a user to be able to run a command and find the row that they are looking for based on a given value for the identifier column.

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

Re: Code for searching for a row in a series object?

Postby EViews Gareth » Mon May 16, 2016 1:00 pm

Well if you just want to show them something:

Code: Select all

%lookupval = "hello world" smpl if a=%lookupval show a.sheet

chester
Posts: 44
Joined: Thu May 12, 2016 11:14 am

Re: Code for searching for a row in a series object?

Postby chester » Mon May 16, 2016 1:46 pm

So there are a few more details to my problem now.
A user would actually want to find the Identifier value using the value in another (non-identifier) column.
The problem is that the user will not type in the exact value in that column so we will have to use wildcards when using their input.
Is this possible? This is my problem in pseudocode if that helps.

%lookupval = "substring of actual value"
smpl if a LIKE %lookupval
show Identifier on the same row as 'a'

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

Re: Code for searching for a row in a series object?

Postby EViews Gareth » Mon May 16, 2016 2:04 pm

No.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests