Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
please look at my example, I try to build a loop for becoming a new field. This table should be the result at the end of the loop...
ID / Objekt / Tmp_ID
1 / A / Null
2 / B / Null
3 / C / 3
4 / D / 4
5 / E / Null
Thanks
Hi There.
Try this:
Tabelle:
LOAD * INLINE [
ID, Objekt
1, A
2, B
3, C
4, D
5, E
];
ID_Table:
LOAD * INLINE [
ID
1
2
5
];
LEFT JOIN (Tabelle) LOAD
ID, 1 AS TempFlag
RESIDENT ID_Table;
Tmp_Tabelle:
NOCONCATENATE LOAD
ID, Objekt,
IF(TempFlag, NULL(), ID) AS Tmp_ID
RESIDENT Tabelle;
drop Table Tabelle;
drop Table ID_Table;
Kind regards,
Ernesto.
Hi There.
Try this:
Tabelle:
LOAD * INLINE [
ID, Objekt
1, A
2, B
3, C
4, D
5, E
];
ID_Table:
LOAD * INLINE [
ID
1
2
5
];
LEFT JOIN (Tabelle) LOAD
ID, 1 AS TempFlag
RESIDENT ID_Table;
Tmp_Tabelle:
NOCONCATENATE LOAD
ID, Objekt,
IF(TempFlag, NULL(), ID) AS Tmp_ID
RESIDENT Tabelle;
drop Table Tabelle;
drop Table ID_Table;
Kind regards,
Ernesto.
Why do you want to loop here? What Ernesto has proposed should work well for you, unless that is not something you are looking for.
Hi,
One more solution:
Tabelle:
LOAD * INLINE [
ID, Objekt
1, A
2, B
3, C
4, D
5, E
];
Left Join(Tabelle)
LOAD *,1 as Temp_ID;
LOAD * INLINE [
ID
1
2
5
];
NoConcatenate
Final:
LOAD ID,Objekt,if(Temp_ID=1,NULL(),ID) as Temp_ID Resident Tabelle;
DROP Table Tabelle;
That´s right. In the first moment I thought that I have to handle with loop.
Thanks!