cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
%3CLINGO-SUB%20id%3D%22lingo-sub-582643%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ECombining%20rows%20with%20serial%20data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-582643%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHi%20-%20there%20are%20a%20few%20posts%20on%20this%20but%20they%20dont%20address%20this%20specific%20issue%3C%2FP%3E%3CP%3Ei%20need%20to%20get%20from%20example%201%20to%20example%202.%26nbsp%3B%20combine%20rows%20by%20ID%20%23%20into%20one%20row%20with%20data%20aligned%20sequentially.%26nbsp%3B%20Thanks%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CU%3Eexample%201%3C%2FU%3E%3C%2FP%3E%3CP%3Eid%26nbsp%3B%20%26nbsp%3B%20visit%23.%26nbsp%3B%20%26nbsp%3BPGA%26nbsp%3B%3C%2FP%3E%3CP%3E1%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%201%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%205%3C%2FP%3E%3CP%3E1%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%202%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%203%26nbsp%3B%3C%2FP%3E%3CP%3E2%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%203%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2012%3C%2FP%3E%3CP%3E2%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%205%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B7%3C%2FP%3E%3CP%3E2%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%206%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B4%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CU%3Eexample%202%3C%2FU%3E%3C%2FP%3E%3CP%3Eid.%26nbsp%3B%20%26nbsp%3Bvisit%23%26nbsp%3B%20%26nbsp%3B%20PGA.%26nbsp%3B%20%26nbsp%3Bvisit%23.%26nbsp%3B%20%26nbsp%3BPGA.%26nbsp%3B%20%26nbsp%3B%20visit%23.%26nbsp%3B%20PGA%23%3C%2FP%3E%3CP%3E1.%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%201%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B5%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%202%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B3%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%3CP%3E2.%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B3%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%2012%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%205%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B7%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B6%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B4%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-582643%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3EAdvanced%20Statistical%20Modeling%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EContent%20Organization%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-583131%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Combining%20rows%20with%20serial%20data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-583131%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CBLOCKQUOTE%3E%3CHR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F23793%22%20target%3D%22_blank%22%3E%40jsolo01%3C%2FA%3E%26nbsp%3Bwrote%3A%3CBR%20%2F%3E%3CP%3Ethat%20works!%26nbsp%3B%20Thanks%3C%2FP%3E%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%3CP%3ELovely!%20Could%20you%20mark%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F14366%22%20target%3D%22_blank%22%3E%40jthi%3C%2FA%3E%26nbsp%3B's%20answer%20as%20a%20solution%20then%3F%20...%20and%20generously%20spare%20it%20a%20kudo%2Flike%20...%26nbsp%3B%20just%20to%20keep%20people%20motivated.%20%3CLI-EMOJI%20id%3D%22lia_slightly-smiling-face%22%20title%3D%22%3Acara_con_una_leve_sonrisa%3A%22%3E%3C%2FLI-EMOJI%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-582807%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Combining%20rows%20with%20serial%20data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-582807%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3Ethat%20works!%26nbsp%3B%20Thanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-582685%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%3A%20Combining%20rows%20with%20serial%20data%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-582685%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EOne%20option%20is%20to%20create%20new%20grouping%20column%20with%20something%20like%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ECol%20Cumulative%20Sum(1%2C%20%3Aid)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22jthi_3-1671207892330.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_3-1671207892330.png%22%20style%3D%22width%3A%20315px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_3-1671207892330.png%22%20style%3D%22width%3A%20315px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F48381i001723F1B839A191%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22jthi_3-1671207892330.png%22%20alt%3D%22jthi_3-1671207892330.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eafter%20this%20you%20can%20split%20the%20table%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22jthi_0-1671207782024.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1671207782024.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_0-1671207782024.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F48378i99D05ED20E0CF540%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22jthi_0-1671207782024.png%22%20alt%3D%22jthi_0-1671207782024.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Eand%20end%20up%20with%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22jthi_1-1671207790056.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_1-1671207790056.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_1-1671207790056.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F48379i725D8F04E2C1C874%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22jthi_1-1671207790056.png%22%20alt%3D%22jthi_1-1671207790056.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Ethen%20you%20can%20move%20the%20columns%20around%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22jthi_2-1671207877254.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_2-1671207877254.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22jthi_2-1671207877254.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F48380i0F387AA48DBF14D8%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22jthi_2-1671207877254.png%22%20alt%3D%22jthi_2-1671207877254.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
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.