cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
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
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
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