Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have one load and one left join. After that i do a concatenate and then a left join. Now the last left join doesn't have any effect. In this example, I expect George to have a place of 'par'. I have attached the script. Very easy to load and run at your end. Please help.
Thanks,
Ram
Hi,
load * inline
[
name, age
ram,30
raj,40
ramji,50
];
left join
load * inline
[
name,place
ram,kmu
ramji,pap
];
gives
name | age | place |
raj | 40 | |
ram | 30 | kmu |
ramji | 50 | pap |
concatenate
load * inline
[
name,age
george,25
Donald,28
];
gives
name | age | place |
Donald | 28 | |
george | 25 | |
raj | 40 | |
ram | 30 | kmu |
ramji | 50 | pap |
now u do left join on the table above:
left join
load * inline
[
name, place
george,par
];
note that now the join takes place on the combination of two fields name+place as these are the two common fields in the two tables and not only on name.
So u dnt get what u need
To get the desired result, use:
tab1:
load * inline
[
name, age
ram,30
raj,40
ramji,50
];
left join
load * inline
[
name,place
ram,kmu
ramji,pap
];
tab2:
load * inline
[
name,age
george,25
Donald,28
];
left Join(tab2)
load * inline
[
name, place
george,par
];
Concatenate(tab2)
LOAD * Resident tab1;
DROP Table tab1;
Hi,
load * inline
[
name, age
ram,30
raj,40
ramji,50
];
left join
load * inline
[
name,place
ram,kmu
ramji,pap
];
gives
name | age | place |
raj | 40 | |
ram | 30 | kmu |
ramji | 50 | pap |
concatenate
load * inline
[
name,age
george,25
Donald,28
];
gives
name | age | place |
Donald | 28 | |
george | 25 | |
raj | 40 | |
ram | 30 | kmu |
ramji | 50 | pap |
now u do left join on the table above:
left join
load * inline
[
name, place
george,par
];
note that now the join takes place on the combination of two fields name+place as these are the two common fields in the two tables and not only on name.
So u dnt get what u need
To get the desired result, use:
tab1:
load * inline
[
name, age
ram,30
raj,40
ramji,50
];
left join
load * inline
[
name,place
ram,kmu
ramji,pap
];
tab2:
load * inline
[
name,age
george,25
Donald,28
];
left Join(tab2)
load * inline
[
name, place
george,par
];
Concatenate(tab2)
LOAD * Resident tab1;
DROP Table tab1;