I am trying to solve for a condition where for a given partition of rows if number in row1 and row2 has a matching 6 or more digit sequence then mark the second row as 0 in a new field.
I used multi row formula as shown below:
If [Name] = [Row-1:Name] and
(REGEX_Match([Number], '.*(\d{6}).*') = REGEX_Match([Row-1:Number], '.*(\d{6}).*'))
then
0
Else
1
Endif
Sample input
Name | Phone |
Oscar | 234567890 |
Oscar | 345678901 |
Zoro | 1122333444 |
Zoro | 9988776600 |
expected output:
Name | Phone | result |
Oscar | 234567890 | 1 |
Oscar | 345678901 | 0 |
Zoro | 1122333444 | 1 |
Zoro | 9988776600 | 1 |
but I am getting
Name | Phone | result |
Oscar | 234567890 | 0 |
Oscar | 345678901 | 1 |
Zoro | 1122333444 | 0 |
Zoro | 9988776600 | 1 |
@Yuri24 because i count only duplication on any 6th digit. so if they have any 6th digit is same, then it will be count as match.
but fixed is simple, i will count unique of recordID, to ensure duplicate only happen in different rows.