Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a table with the following fields:
ACCOUNT_ID | SEQUENCE_ID | FLAG |
---|---|---|
001 | 1 | Y |
001 | 2 | Y |
001 | 3 | N |
001 | 4 | Y |
001 | 5 | Y |
I want to create an expression to evaluate if there's a FLAG=N between two FLAG=Y like the case I showed for ACCOUNT_ID=001
Is there any way to check the row with a FLAG=N and then see if the last 2 rows are Y and the next 2 rows are Y?
Or it is better to do it in the script? How could I do it?
I would like to show the accounts that satisfy this conditions.
Thank you!!!
maybe
a straight table with 2 dims
ACCOUNT_ID SEQUENCE_ID
2 expressions
FLAG
match(above(FLAG) & above(FLAG,2) & FLAG & below(FLAG) & below(FLAG,2), 'YYNYY')
maybe
a straight table with 2 dims
ACCOUNT_ID SEQUENCE_ID
2 expressions
FLAG
match(above(FLAG) & above(FLAG,2) & FLAG & below(FLAG) & below(FLAG,2), 'YYNYY')