i have the data set below and i am trying to create logic that if source id is present in any destination ID above then it should be replaced as 0
IIF([Source ID]==[Destination ID] THEN 0 ELSE [Source ID])
Join by source ID and Destination ID, and summarize J-anchor output, then you can identify the target source ID. So you can replace value with 0 for those records having target source ID with one more Join tool.
Finally you can Union it with L-anchor if needed.
Maybe you might have asked for something more complicated process, and I might overlooked it. Let me know if I'm in wrong way.