Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
NewField - If (ID1 = Notfound, check ID2 else keep ID1,) please refer screenshot for better understanding.
LOAD * INLINE [
Name, ID1, ID2
Red, Notfound,
Pink, Notfound,
Blue, 45654565,
Red, Notfound, 520022386
Green, Notfound, 520022386
Red, 45456456,
Red, 78945265, 78945265
Green, 22165466, 22165466
Pink, 46545489,
Blue, 54848963,
];
Hi,
Your load inline is different from the screenshot for items Red and Green. Anyway.
Not sure if this is what you want, basically created an if condition that if ID=Notfound, it will still check the ID2. If the ID2 is empty then it will take ID1 .
temp:
LOAD * INLINE [
Name, ID1, ID2
Red, Notfound,
Pink, Notfound,
Blue, 45654565,
Red, Notfound, 520022386
Green, Notfound, 520022386
Red, 45456456,
Red, 87979956, 78945265
Green, 84516566, 22165466
Pink, 46545489,
Blue, 54848963,
];
LOAD Name, if(ID1 = 'Notfound', if(len(ID2)=0, ID1, ID2), ID1)
resident temp;
drop table temp;
Hi,
Your load inline is different from the screenshot for items Red and Green. Anyway.
Not sure if this is what you want, basically created an if condition that if ID=Notfound, it will still check the ID2. If the ID2 is empty then it will take ID1 .
temp:
LOAD * INLINE [
Name, ID1, ID2
Red, Notfound,
Pink, Notfound,
Blue, 45654565,
Red, Notfound, 520022386
Green, Notfound, 520022386
Red, 45456456,
Red, 87979956, 78945265
Green, 84516566, 22165466
Pink, 46545489,
Blue, 54848963,
];
LOAD Name, if(ID1 = 'Notfound', if(len(ID2)=0, ID1, ID2), ID1)
resident temp;
drop table temp;
Tab :
LOAD * INLINE [
Name, ID1, ID2
Red, Notfound,
Pink, Notfound,
Blue, 45654565,
Red, Notfound, 520022386
Green, Notfound, 520022386
Red, 45456456,
Red, 78945265, 78945265
Green, 22165466, 22165466
Pink, 46545489,
Blue, 54848963,
];
Tab1:
Load
*,
if(isnum(ID1),ID1,if(isnum(ID2),ID2,ID1)) as ID3
Resident Tab;
Drop table Tab;