sorting/ ranking the data in a table

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator

saranya
Posts: 41
Joined: Wed Nov 16, 2016 5:51 am

sorting/ ranking the data in a table

Postby saranya » Sun Mar 19, 2017 11:11 pm

Hi,

Is there a way to rank elements in a particular column of a table? I went through the rank and sort functions available within eviews. However, was not able to implement the same for a table.

My end requirement is to rank the data series based on the period of observation. Kindly help. I'm also adding the codes I used to find the first period of observation and last period of observation for the variables in the group.

I.e when we use the below codes, I need to rank the data in the 4th and 5th columns of the table named date.

group all *
all.drop resid
%name =""
table date
date(1,1)= "Series Name"
date(1,2)= "Series Strt Date"
date(1,3)= "Series End Date"
date(1,4)= "Start_Datenum"
date(1,5)= "End_Datenum"
for !i=1 to all.@count
%name = all.@seriesname(!i)
%smpl_first= {%name}.@first
%smpl_last= {%name}.@last
!date_st= @dateval(%smpl_first)
!date_end= @dateval(%smpl_last)
date(!i+1,1) = %name
date(!i+1,2)= %smpl_first
date(!i+1,3)= %smpl_last
date(!i+1,4)= !date_st
date(!i+1,5)= !date_end
next

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

Re: sorting/ ranking the data in a table

Postby EViews Gareth » Mon Mar 20, 2017 8:16 am

Unfortunately there is no table sort routine. You would have to put the data into a matrix and sort it there. The TTOM function would be useful.
Follow us on Twitter @IHSEViews

saranya
Posts: 41
Joined: Wed Nov 16, 2016 5:51 am

Re: sorting/ ranking the data in a table

Postby saranya » Tue Mar 21, 2017 2:18 am

serves the purpose. Thanks Gareth :)


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 20 guests