Forum Discussion
Anonymous
7 years agoNot applicable
Conditional column selecting column from other table
Hello all. I need a help. I have two tables: Table A with customer by entity name Table B with customer by entity name and short name How can I add a conditional column in Table A selectin...
- 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
7 years agoNot applicable
Thanks, Anonymous
Last doubt: is it possible to have the merged column (Table2.Column2) in Table A? I am wondering if I can avoid one more table.
Anonymous
7 years agoNot applicable
Anonymous
I think the only way to do that without merging queries would be to add a conditional column straightaway from Table A. This would automatically give customers by entity name a short name if it included something like "power bi" or "microsoft" and return the regular entity name if it has no short name.