Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I am trying to move values from one field into another. Currently I have my dataset looking like below:
This table is created by left joining on number with the pulling field being location2.
I want to move the values from location2 into the location field.
Number | Pallet | Location | Location2 |
1 | 1aaa | London | |
1 | 1aab | London | |
1 | 1aab | London | |
2 | Paris | ||
2 | 2fbb | Paris | |
2 | 2fbb | Paris | |
2 | 2fbb | Paris | |
3 | 3Sab | Madrid | |
3 | 3Sad | Madrid |
|
Thanks,
Tom
Hi,
This will give you required output.
LOAD Number,
Pallet,
if(isnull(Location),Location2,Location) as Location,
Location2
FROM
(ooxml, embedded labels, table is Sheet1);
Thanks
Paridhi
Hi,
This will give you required output.
LOAD Number,
Pallet,
if(isnull(Location),Location2,Location) as Location,
Location2
FROM
(ooxml, embedded labels, table is Sheet1);
Thanks
Paridhi
Try this....
Test:
LOAD * Inline [
Number ,Pallet,Location, Location2
1 ,1aaa ,London ,
1 ,1aab ,London ,
1 ,1aab ,London ,
2 , , ,Paris
2 ,2fbb , ,Paris
2 ,2fbb , ,Paris
2 ,2fbb , ,Paris
3 ,3Sab ,Madrid ,
3 ,3Sad ,Madrid ,
]
;
TestNew:
LOAD Number ,Pallet
,
if( len(trim(Location))= 0 , Location2 ,Location ) as NewLoc
Resident Test ;
drop Table Test;
If only one or the other will ever have a value, you can just do this
Location & Location2 as Location