cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jsolo01
Level I

Combining rows with serial data

Hi - there are a few posts on this but they dont address this specific issue

i need to get from example 1 to example 2.  combine rows by ID # into one row with data aligned sequentially.  Thanks


example 1

id    visit#.   PGA 

1      1          5

1      2          3 

2      3        12

2      5         7

2      6         4

 

example 2

id.   visit#    PGA.   visit#.   PGA.    visit#.  PGA#

1.      1         5          2           3     

2.       3        12        5           7           6         4

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Combining rows with serial data

One option is to create new grouping column with something like

Col Cumulative Sum(1, :id)

jthi_3-1671207892330.png

 

after this you can split the table

jthi_0-1671207782024.png

and end up with

jthi_1-1671207790056.png

then you can move the columns around

jthi_2-1671207877254.png

 

-Jarmo

View solution in original post

3 REPLIES 3
jthi
Super User

Re: Combining rows with serial data

One option is to create new grouping column with something like

Col Cumulative Sum(1, :id)

jthi_3-1671207892330.png

 

after this you can split the table

jthi_0-1671207782024.png

and end up with

jthi_1-1671207790056.png

then you can move the columns around

jthi_2-1671207877254.png

 

-Jarmo
jsolo01
Level I

Re: Combining rows with serial data

that works!  Thanks

fja
fja
Level III

Re: Combining rows with serial data


@jsolo01 wrote:

that works!  Thanks


Lovely! Could you mark @jthi 's answer as a solution then? ... and generously spare it a kudo/like ...  just to keep people motivated.