Hi, I am new here and this is my first post, can someone please guide me here. Below is my sample data set
Request ID | Flag 1 | Flag 2 | Flag 3 |
A | 1 | 0 | 0 |
A | 0 | 1 | 0 |
A | 1 | 0 | 0 |
B | 1 | 0 | 0 |
B | 0 | 0 | 1 |
B | 0 | 1 | 0 |
B | 0 | 0 | 0 |
B | 0 | 1 | 0 |
C | 0 | 0 | 1 |
C | 0 | 1 | 0 |
C | 0 | 0 | 0 |
D | 0 | 1 | 0 |
D | 0 | 0 | 0 |
D | 1 | 0 | 0 |
D | 0 | 0 | 1 |
I need to extract distinct Request ID's that have all three flags has 1 in any row into a new column. In the above table the final output column would identify 'B' and 'D' Request ID's as they have 1 in columns Flag 1, Flag 2, Flag 3.
¡Resuelto! Ir a solución.
I'd do this ...
- Summarize tool .... group by RequestID, sum Flag1, Flag2, Flag3
- Filter tool ... Flag1 > 0 and Flag2 > 0 and Flag3 > 0
Hi @Rag1
Here is how you can do it.
Workflow:
1. Using summarize tool I am finding of max of flag for each record id. This way is a flag has atleast a row as 1it will be taken in max.
2. Using filter keep only record ids where max_flag1+max_flag2+max_flag3 (i,e all flag atleast one 1).
3. Using join tool joining on record id. This way only record ids with all flags present in outputted.
Hope this helps : )
Thanks everyone, all solutions worked!
Happy to help : ) @Rag1
Cheers and have a nice day!