Thank you for your reply. The problem is that I want it to create new column labels since the data in the table has nothing to split by. If I group by subject and ask it to split value and date what do I pick for split by? I want each observation to just be listed under a new column created for a duplicate observation
Subject Value Date Subject Value Date Value2 Date2 value3 date3
A 1 x A 1 x 2 y . .
A 2 y ----> B 3 z 4 g 5 f
B 3 z
B 4 g
B 5 f
Create a new column that gives a sequence number for each of your subjects
if(row()==1,counter-1); If(lag(:subject) != :subject, counter=1, counter=counter+1); counter;
Then you can split by the new column
Hi! I've got a similar problem. I'd like to merge rows with the same time value without creating new columns. So in the example below rows 75629 and 75630 would become one row with more data in it and 75631/2 would move up one number. Is there a way to do something like this?
You mentioned this in a post a few years ago "I've had data sets where there were multiple rows that needed to be "combined" into a single observation. How to do it depended on whether I wanted the average or sum (or....) of those rows."
Can you tell me how to do this? (I would want a sum of the value in a variable for unique subject IDs with multiple rows of data)
There are no labels assigned to this post.