- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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 );
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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.