FINDDUPLICATES
- FINDDUPLICATES(array, include_first_instance, ignore_blanks)[source]
Identifies duplicate elements in an array and returns a boolean array.
FINDDUPLICATES scans array and returns a boolean array of the same length, where True indicates that the corresponding element is considered a duplicate. Behavior can be customised using include_first_instance and ignore_blanks.
- Parameters:
array (
Operand) –The array to check for duplicates. Must be a valid array type or object array.
Supported types:
BOOLEAN_ARRAY
INTEGER_ARRAY
DECIMAL_ARRAY
STRING_ARRAY
DATE_ARRAY
TIME_ARRAY
DATETIME_ARRAY
OBJECT_ARRAY
include_first_instance (
Operand|bool) –Determines whether the first occurrence of a duplicate should be marked as True. If True, the first occurrence is included; if False, only subsequent duplicates are marked.
Supported types:
BOOLEAN
ignore_blanks (
Operand|bool) –Determines whether blank values (null or empty strings) should be ignored in duplicate detection.
Supported types:
BOOLEAN
- Return type:
- Returns:
A formula object that evaluates to a boolean array of the same length as array, where True indicates a duplicate element according to the specified rules.
Supported types:
BOOLEAN_ARRAY
- Raises:
If array is not an array type - If include_first_instance or ignore_blanks is not BOOLEAN
Examples
Basic usage including first instance:
FINDDUPLICATES( ["A", "B", "A", "C"], include_first_instance=True, ignore_blanks=False ) # Returns [True, False, True, False]
Excluding first instance:
FINDDUPLICATES( ["A", "B", "A"], include_first_instance=False, ignore_blanks=False ) # Returns [False, False, True]