Count unique values

Hi,
how can I count the number of unique values in a column and store this value?
Thanks!

Welcome to the SeaTable Forum!

SeaTable offers multiple count formulas:

  • count(): counts the number of numeric items
  • counta(): counts the number of non-empty values
  • countall(): counts the number of all elements including text and blanks
  • countblank(): Counts the number of empty values
  • countItems(): counts the number of items in column of type multiple select, collaborator, image, and file
  • countlinks(): counts the number of links in a link column

So what exactly do you want to count?

I would like to count unique values e.g. if the values are 1,2,2,3 in 4 rows, I would like to get a count of 3 (3 unique values 1,2,3).
Thanks!

There is no such function in SeaTable.

But maybe you provide a bit more context. In which column type do you want to store multiple values? A text column?! (A cell in a number column can only contain one value. Comma-separated multiple values are NOT supported.) But this is not the kind of content that text columns are meant to store.

How would this column be filled?

What I am driving at is this: If you are coming from Excel, you may need to change the way out structure your data. SeaTable is not a spreadsheet. SeaTable is a database. Depending on the meaning of the values of the numbers, there may be another way of achieving your objective.

Thanks for your answer - I do agree, that the data structure is not optimal, however the data is out of a report of another database, I am trying to connect with other data in seatable.

This report does not provide a unique identifier, but lists a number of trainings. If a training was given to more than one person, there are several rows, with the same trainings-ID and a differing participant name. I was hoping, I could still work with the data in seatable to automatically retrieve the number of trainings given, but seems like this is difficult, since I also cannot automate the deduplication process, to gain a list of unique trainings. If there are other ways I have missed so far (just started to use this and I am not programmer) I would be grateful for a hint.

Thanks!!

I see the problem!

You’d have to write a little Python script to achieve the desired result. The script would walk through your input table and write the results in a separate table. Using a Python script has the additional advantage that it can be run automatically in certain intervals.

We can develop such a script for you. If relevant, please write to support@seatable.io.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.