Delete duplicate rows based on two columns

371 views
Skip to first unread message

Salem Ababneh

unread,
May 27, 2018, 9:12:04 AM5/27/18
to OpenRefine

Hello OpenRefine community,

I'm new to OpenRefine and still learning this amazing software. I have a question that I hope you guys could help me with:

Lets say I have 3 columns:
  • Name
  • Mobile Number
  • Type
In each row I have customer transaction, which contains his name, mobile number, and the type of transaction that he/she did.
What I'm trying to do that, if the customer did two transactions from the same type, I want only the first one, for example:

  • Row 1 - Salem - 0797965656 - Request Book
  • Row 2 - Jack - 07921265626 - Request Pen
  • Row 3 - Jack - 07921265626 - Request Book
  • Row 4 - Salem - 0797965656  - Request Book
I want this table to be cleaned to:

  • Row 1 - Salem - 0797965656 - Request Book
  • Row 2 - Jack - 07921265626 - Request Pen
  • Row 3 - Jack - 07921265626 - Request Book
How is this possible? Is there a code that will catch this? 

Thanks

Isao Matsunami

unread,
May 27, 2018, 9:34:11 AM5/27/18
to openr...@googlegroups.com
How about this?

1. Create new column by "Add column based on this column"
    set new column name as NamePhone
    set expression as cells["Name"].value.toString() + cells["Phone Number"].value.toString()
    ----   This column works as identifier
2. Apply "Black down" on this new column NamePhone   --- duplicated cells become blank
3. Apply "Facet by blank" of "Customized facets"
4. remove all black rows


--
You received this message because you are subscribed to the Google Groups "OpenRefine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Salem Ababneh

unread,
May 28, 2018, 4:35:11 PM5/28/18
to OpenRefine
Thank you Isao! that solved it perfectly!
To unsubscribe from this group and stop receiving emails from it, send an email to openrefine+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages