Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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:

SELECT

    ADRC_D.CLIENT

    , ADRC_D.ADDRNUMBER

    , COALESCE (ADRC_I.NAME1, ADRC_D.NAME1) AS Name1

FROM    

    ADRC_D

    LEFT OUTER JOIN

        ADRC_I

ON

    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 ?

Many Thanks

Tags:
Former Member
replied

Hi Bush,

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.

Sreehari

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question