Hi there,
I have a dataset similar to the following:
I'm having trouble figuring out how to flag records where the value in the id_parent field exists in the id field. That is, using the example dataset above, I'd like to create new variable, flag_parentidinidfield, that flags rows 2, 3, and 5 as having a value of id_parent that exists in id - see below:
Any advice or assistance about how to do this would be greatly appreciated.
Thanks,
Erika
I have a dataset similar to the following:
Code:
clear input byte rownumber int id int id_parent 1 1234 7869 2 1111 1234 3 9999 8888 4 8888 . 5 7777 8888 6 2222 . end
Code:
clear input byte rownumber int id int id_parent byte flag_parentidinidfield 1 1234 7869 0 2 1111 1234 1 3 9999 8888 1 4 8888 . 0 5 7777 8888 1 6 2222 . 0 end
Thanks,
Erika
Comment