Forum Discussion
Conditional column selecting column from other table
- Anonymous7 years ago
Anonymous
Got it! So you can merge the tables with a LEFT JOIN. Then you can create a new conditional column with the format:
IF [new column] = null THEN output=Column1, ELSE [new column]
]
Anonymous
You're going to want to have a column with a unique ID that you can use to join Table A and Table B. Then you can select "Merge Queries" in the query editor, match on the unique ID, and make sure that it is the Join Kind "Left Outer (all from first, matching from second)." That way, since Table B doesn't have all of the entries that Table A has, the short name column entries that don't have a match will be replaced with a null in your new, merged table.
Is that what you want to do?
Hi Anonymous
I also want to change the null that I will have in the merged table by the Customer name (entity name) from Table A.
- Anonymous7 years agoNot applicable
Anonymous
So do you have some customers in Table B that are not in Table A? If so, since you are using a left join, those customers would not appear in your merged table.
- Anonymous7 years agoNot applicable
Anonymous
But I need to have a complete table by short name or entity name.
- Anonymous7 years agoNot applicable
Anonymous
I think I am confused as to what your two tables contain. Does Table A overlap with Table B? I know that there are entries in Table A that are not in Table B but are there also entries in Table B that are not in Table A?