Announcements
The Google Cloud Community will be in read-only from July 16 - July 22 as we migrate to a new platform; refer to this community post for more details.

Avoid duplicate values

How can I validate the data entered in a column to avoid duplication? I canโ€™t assign this column as key column because I am already using that assignment

Solved Solved
0 2 522
1 ACCEPTED SOLUTION

Steve
Platinum 5
Platinum 5

In your Valid If expression, use something like this:

ISBLANK(
  FILTER(
    "table",
    AND(
      ([_ROWNUMBER] <> [_THISROW].[_ROWNUMBER]),
      ([unique-column] = [_THISROW].[unique-column])
    )
  )
)

replacing table with the name of the table in which the column value should be unique, and unique-column with the name of the column whose values should be unique.

This expression looks for any rows other than the current one that have the same column value. If there are any, the current rowโ€™s column value is a duplicate.

View solution in original post

2 REPLIES 2

Steve
Platinum 5
Platinum 5

In your Valid If expression, use something like this:

ISBLANK(
  FILTER(
    "table",
    AND(
      ([_ROWNUMBER] <> [_THISROW].[_ROWNUMBER]),
      ([unique-column] = [_THISROW].[unique-column])
    )
  )
)

replacing table with the name of the table in which the column value should be unique, and unique-column with the name of the column whose values should be unique.

This expression looks for any rows other than the current one that have the same column value. If there are any, the current rowโ€™s column value is a duplicate.

Top Labels in this Space