Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am creating a Flag that looks at another column, and if it is Null, set it as 1 in the flag. (If SuperiorIndicator is null, set SuperiorIndicatorFlag to 1.)
Here is my code:
SuperiorIndicatorTemp:
Load SuperiorIndicator,
EQUNR,
1 as SuperiorIndicatorFlag
Resident SCD
Where Len(SuperiorIndicator) = 0
;
Left Join (Equipment)
Load EQUNR,
SuperiorIndicatorFlag
Resident SuperiorIndicatorTemp
;
Drop Table SuperiorIndicatorTemp
;
Any help would be greatly appreciated.
If you don't have matching EQUNR, then still you will get nulls in SuperiorInidcatorFlag.
Left Join (Equipment)
Load EQUNR,
SuperiorIndicatorFlag
Resident SuperiorIndicatorTemp
Hi,
Try Below Code:
SuperiorIndicatorTemp:
Load SuperiorIndicator,
EQUNR,
if(ISNULL(SuperiorIndicatior),1,0) as SuperiorInidcatorFlag
RESIDENT SCD;
HTH
sushil
Hi,
please check below code
.I hope it help to u
SuperiorIndicatorTemp:
Load SuperiorIndicator,
EQUNR,
1 as SuperiorIndicatorFlag
Resident SCD
Where Len(SuperiorIndicator) = 0 or isnull(SuperiorIndicator)
;
Left Join (Equipment)
Load EQUNR,
SuperiorIndicatorFlag
Resident SuperiorIndicatorTemp
;
Drop Table SuperiorIndicatorTemp
If you don't have matching EQUNR, then still you will get nulls in SuperiorInidcatorFlag.
Left Join (Equipment)
Load EQUNR,
SuperiorIndicatorFlag
Resident SuperiorIndicatorTemp
That was it. Thanks Anbu.
SuperiorIndicatorTemp:
Load SuperiorIndicator,
EQUNR,
1 as SuperiorIndicatorFlag
Resident SCD
Where Len(SuperiorIndicator) = 0
;
InnerJoin (Equipment)
Load EQUNR,
SuperiorIndicatorFlag
Resident SuperiorIndicatorTemp
;
Drop Table SuperiorIndicatorTemp
;