cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
doraemengs
Level III

Generate new column (string) with compose of the same ID in different rows and excluded duplicate string

Hi,

 

I want to generate a new column that combines the strings in the same ID in different rows as the example table (I want column results). Thank you

ID

Ab

results

1

A2, B3

A2, B3, B56, C7, DR5

1

A2, B56, C7, DR5

A2, B3, B56, C7, DR5

1

DR5

A2, B3, B56, C7, DR5

2

A56, B9, C0, DQ89

A56, B9, C0, DQ89

2

 

A56, B9, C0, DQ89

2

DQ89

A56, B9, C0, DQ89

3

A2

A2, DR5

3

DR5

A2, DR5

3 A2, DR5
2 REPLIES 2
txnelson
Super User

Re: Generate new column (string) with compose of the same ID in different rows and excluded duplicate string

Here is the formula I worked out.  Others may have better ways

curID = :ID;
theRows = Current Data Table() << get rows where( :ID == curID );
theArray = Associative Array( Words( Concat Items( :Ab[theRows] ), ", " ) );
Concat Items( theArray << get keys );

txnelson_0-1722022698565.png

 

 

Jim
hogi
Level XII

Re: Generate new column (string) with compose of the same ID in different rows and excluded duplicate string