What you are doing does not make much sense. Perhaps you could post some sample data and your desired results and we can point you in the right direction.
a couple things to note:
First, having multiple columns based on the same entity is a bad design.
Next, for better performance - if you have to combine columns like you are, consider using a hash key.
-- Itzik Ben-Gan 2001