BookmarkSubscribeRSS Feed
uksusu
Calcite | Level 5
I have a large dataset similar in set up to that below:

account date value
1 month1 10
1 month2 25
1 month3 19
2 month1 8
2 month2 0
2 month3 18
3 month1 23
3 month2 9
3 month3 27

What I want to do is to collapse the account to 1 row per account and create a new dataset to look like this:
account month1 month2 month3
1 10 25 19
2 8 0 18
3 23 9 27

Do I need to use an array for this, or would transpose work in some way?

Thanks for any help. Message was edited by: uksusu
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Check PROC TRANSPOSE in the SAS DOC, the forum archives, or search the SAS support website for technical / conference reference material on the topic.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

proc transpose site:sas.com
uksusu
Calcite | Level 5
Thanks Scott

It worked a treat.

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
  • 2 replies
  • 680 views
  • 0 likes
  • 2 in conversation