cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar
dadawasozo
This widget could not be displayed.
" alt = "Level IV"/> dadawasozo
Level IV

find unique strings separated by comma for each row in a column and count the total recurrence

Hi,

 

I wonder if there is a way to create column with formula to find unique strings separated by comma in a column and count total recurrence of each like below?

dadawasozo_1-1751749418746.png

 

 




1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: find unique strings separated by comma for each row in a column and count the total recurrence

Here is one way of handling this

txnelson_0-1751756988501.png

Unique Item formula

x = Words( :Input, "," );
For Each( {element, index}, x, x[index] = Trim( element ) );
x = Associative Array( x ) << get keys;
x = Concat Items( x, "," );

Total Recurrence formula

x = Words( :Input, "," );
For Each( {element, index}, x, x[index] = Trim( element ) );
theList = Associative Array( x ) << get keys;
value = "";
For Each( {element}, theList, value = value || "," || Char( N Rows( Loc( x, element ) ) ) );
Substr( value, 2 );
Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: find unique strings separated by comma for each row in a column and count the total recurrence

Here is one way of handling this

txnelson_0-1751756988501.png

Unique Item formula

x = Words( :Input, "," );
For Each( {element, index}, x, x[index] = Trim( element ) );
x = Associative Array( x ) << get keys;
x = Concat Items( x, "," );

Total Recurrence formula

x = Words( :Input, "," );
For Each( {element, index}, x, x[index] = Trim( element ) );
theList = Associative Array( x ) << get keys;
value = "";
For Each( {element}, theList, value = value || "," || Char( N Rows( Loc( x, element ) ) ) );
Substr( value, 2 );
Jim
dadawasozo
This widget could not be displayed.
" alt = "Level IV"/> dadawasozo
Level IV

Re: find unique strings separated by comma for each row in a column and count the total recurrence

Hi Jim, 

 

it looks like both formula is same

txnelson
Super User

Re: find unique strings separated by comma for each row in a column and count the total recurrence

My error......I corrected my initial post to the correct formula

Jim
dadawasozo
This widget could not be displayed.
" alt = "Level IV"/> dadawasozo
Level IV

Re: find unique strings separated by comma for each row in a column and count the total recurrence

Thank you for the helps!!!

Recommended Articles