BookmarkSubscribeRSS Feed
hdg
Obsidian | Level 7 hdg
Obsidian | Level 7

Hello everyone,

I have the following dataset

    dateNAME OF FORMERabc
3/31/2014weight0.325350.129620.1317
3/31/2014active-0.284150.021460.01334
4/30/2014weight0.32690.132790.13384
4/30/2014active-0.281470.023710.01418

I would like to sort the rows based on max date in the above table and the  name = active. In this case all rows will be sorted based on row 4:

for example the resulting data set looks like below.

This is just a small example of 3 columns but I could have more.

    dateNAME OF FORMERacb
3/31/2014weight0.325350.13170.12962
3/31/2014active-0.284150.013340.02146
4/30/2014weight0.32690.133840.13279
4/30/2014active-0.281470.014180.02371

Any help is appreciated many Thanks!

1 REPLY 1
ballardw
Super User

Doesn't look like a sort at this point just a column reorder. There are several threads in the forum about reordering data columns in a data set.


sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 632 views
  • 0 likes
  • 2 in conversation