Left Join : isnull(T1.Field, T2.Field)
I'm translating some legacy SQL into HANA model.... and I'm going around in circles with this one.
Here's some 'traditional' SQL to illustrate what I am trying to do:
, COALESCE (ADRC_I.NAME1, ADRC_D.NAME1) AS Name1
LEFT OUTER JOIN
ADRC_D.CLIENT = ADRC_I.CLIENT AND
ADRC_D.ADDRNUMBER = ADRC_I.ADDRNUMBER
In a calculation view, I tried IFFNULL, but that won't let me include columns in my expression, unless I've used them as 'select' columns ... and I do not want them as select columns.
This must be a really common requirement, so I am sure there is a standard method of achieving ?
Sreehari V Pillai replied
Yes if you want to use the IFNULL functionality in a graphical calculation view, you need to select the used columns first(By the way, not selecting columns doesn't make any sense. In your SQL also, you are selecting ADRC_I.NAME1 and ADRC_D.NAME1. In calculation view, you are selecting it directly instead ). Otherwise , you can go for a scripted calculation view with case statement in the selection to achieve the same.