取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
选择语言 隐藏翻译栏
StarfruitBob
Level VI

Identifying duplicate lists

Hello,

 

I have :ColA with n items. In :ColB there are string values. Once :ColB is changed to data type Expression, I’m able to use Words() to change the strings into a list. Then I use Sort List() to alphabetically sort the lists.

 

I want to compare the lists in :ColB between the n items in :ColA. Creating a subset of if both n items in :ColA share a common. Example, ItemA and ItemB in :ColA share an exact match of a list in :ColB. 

 

Using the Rows > Row Selection > Select Duplicate Rows functionality does not return what I expect when :ColB is selected.  I would expect, that if I use this functionality, create a subset of the automatically selected “duplicate” rows, and then sort :ColB, either ascending or descending, that I would find pairs of rows with the exact same lists.  This is not the case.  Each list is unique.

 

Any ideas of how to identify potential duplicate matches of lists for each n items in :ColA?

 

This will all be coded in JSL, I just need to know what's going on before I proceed.

Learning every day!
1 个已接受解答

已接受的解答
StarfruitBob
Level VI

Re: Identifying duplicate lists

As it turns out, I was misinterpreting the function of Select Duplicate Rows. Since I had never used this function before, I thought it would select duplicate rows and the rows they were duplicating. The function as it works is exactly what I need.  I apologize for my delayed response.

Learning every day!

在原帖中查看解决方案

3 条回复3
StarfruitBob
Level VI

Re: Identifying duplicate lists

Since there's no reply to this yet, my workaround is to use a for loop and compare :colA for each row.  I'll look at rows n & n + 1 and if they're equal I'll flag them somehow and add to the for loop counter, because both of the rows will not need to be counted again.

I'd like to learn if someone has simple alternative.

Learning every day!
ErraticAttack
Level VI

Re: Identifying duplicate lists

In response to 

Any ideas of how to identify potential duplicate matches of lists for each n items in :ColA?

Here is an example.

Names Default to Here( 1 );
dt = New Table( "Untitled 490",
	Add Rows( 4 ),
	Compress File When Saved( 1 ),
	New Column( "A", Character, "Nominal", Set Values( {"A", "B", "C", "D"} ) ),
	New Column( "B",
		Expression,
		"None",
		Set Values( {{"A", "B"}, {"A", "b"}, {"B", "A"}, {"A", "B"}} )
	)
);

// this sorts the lists -- disable if you dont want to sort
For Each Row( dt,
	dt:B = Associative Array( dt:B[] ) << Get Keys
);

unique items = Associative Array( dt:B );
Jordan
StarfruitBob
Level VI

Re: Identifying duplicate lists

As it turns out, I was misinterpreting the function of Select Duplicate Rows. Since I had never used this function before, I thought it would select duplicate rows and the rows they were duplicating. The function as it works is exactly what I need.  I apologize for my delayed response.

Learning every day!

推荐文章