Hi I have two columns where I have to match and based on the condition I have to remove the records which do not satisfy
prd_id | code | code_2 |
123 | PB | INT |
123 | PB | TK |
345 | PB | TK |
345 | CK | NY |
789 | PB | INT |
Condition:
1. if code and code_2 has PB and INT, that whole record (prd_id) is a pass like prod_id 123
2. 345 record does not have PB and INT so it is as exception
Output:
prd_id | result |
123 | pass |
789 | pass |
345 | exception |
@Sshasnk
Like this?
as per @Qiu 's solution - treat this like you would do in Excel. For each of your tests you can create a column using the formula tool for the result of the test (Yes or No; true or false), and then just filter out the rows that don't pass your test.
Using this method you can build some very robust rules in a transparent way.
So for your data the rule would be in a formula tool - a new field called "Rule1Pass", with a type of String
if [code]=='PB' and [code_2] = 'INT' then 'Pass'
else 'Exception'
endif