Formulas: Unique() and Duplicates()
Deduplicates values from a list
Another way to say it...
Hey Coda, I have a list with duplicate values. Will you pull out just one of each?
Outputs duplicate values in a list
Hey Coda, will you tell me which values in his list have duplicates?
Both Unique() and Duplicate() share the same, single parameter:
This is the item you want to locate within the list to check whether it's unique or a duplicate.
Unique() is a powerful formula to find the unique values within a list. Lets just take the list of people from our for example.
Here is a list of the first 25 peoples ages:
And here is the list of the unique ages
Now lets look at the whole . Unique can help us answer questions like: How many different aged individuals are there? How many unique favorite animals are there? How many different birthdays will be have to celebrate? How many different email domains do people have?
Duplicates() is a relatively new additions to the CFL (Coda Formula Language), and while it may seem like a life-saver at first, its unfortunately not as helpful as you might think when attempting to identify and squash duplicate values in a list.
Before we get to use-cases though, let’s just learn how it works.
Here’s the same list of 25 people’s ages that we had in the Unique() section.
And here's is the list of the duplicate values using Duplicates().
Look at the values and data that Duplicates() returns. What kind of information does it give you, and what type of information does it not provide? Think about it for a moment and type your thoughts into the boxes below. Then, when you are done, press the button to view some potential answers
Duplicates provides the following data
Duplicates does NOT provide. . .