Hey,
I have two files and I need below results:
1. If both files are present then I need the common values between them (i.e a Join tool)
2. If 1 of the file is missing, give the output of the file which is available.
I have been using the Join tool but it gives an error whenever 1 file is missing. Is there any other tool which could perform the required task?
Thanks!
Solved! Go to Solution.
What you can do in that case is use a union before the join and create dummy fields, so if the file doesn't come through, there's still something there. Then the join will work. You can even give it an ID of -9999 or something like that to filter it out.
@StephenR Sorry but I am not able to follow you. I will appreciate if you could help me with this workflow. Thanks!
Unfortunately I don't think @StephenR method would work here, though it is a valid way of preventing the join tool from erroring, it will mean all your records fall out of either the left or right side not the J output which you appear to be using downstream.
Presuming this is related to your other issue regarding the interface tools; check out how you can control a 'route' based on the checkbox tool using the 'detour'.
If both files are configured then perform the join, else detour around the join.
The detour essentially prevents part of the workflow from running so the 'join' error won't be reported if you detour around it when the user doesn't bring through a file.
Something like in the image below.
Ben
I've adjusted and annotated the sample to show what I mean. Let me know if you have any more questions about it.
EDIT: If you are using Interface tools, then @BenMoss 's answer is much better.
The point about not having an actual join is true as well, you'd have to expect something out of the left or right join to capture a true lack of data.
@BenMoss Yes, you are right, this is associated with my earlier posted issue. Thanks so much, your idea worked.