Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am loading from 2 different sharepoint locations and the column names are different. However i need to join these 2 tables based on 1 column name.
Note, I can't change the source column names .
for eg:
LOAD [field 1], [Associate]
from <sharepoint>;
LOAD [field 2], [Associate Name]
from <sharepoint>;
Now i need to join these 2 tables.
[field1] [field2] [Associate Name]
Please help.
Thanks
Rename your fields, so they have the same name
LOAD [field 2], [Associate Name] as [Associate] from;
Use aliases to name them the same in the script.This will join on Associate. you can left join as well as join.
Table:
LOAD
[field 1],
[Associate]
from <sharepoint>;
join (Table)
LOAD [field 2],
[Associate Name] as [Associate]
from <sharepoint>;
Hello,
Try using the following scheme:
Table1:
LOAD * INLINE [
Key, A, VL1
1, A1, 1000
2, A2, 2000
3, A3, 3000
1, A1, 6000
];
Table2:
LOAD * INLINE [
Key, C, Desc
1, A1, Money
2, A2, Cheque
3, A3, Boleto
];
LEFT JOIN (Table1)
LOAD
Key,
C,
Desc
Resident Table2;
DROP Table Table2;
Hi, Then at the end of the script add the following syntax Drop Field [Associate] Thanks
Hi Jonathan,
When I followed your above approach, Field2 values are coming as blank.
Actual Code:
table1:
LOAD
[Practice Area ],
[Associate Working On ]
FROM
<sharepoint>
Tab23:
NOCONCATENATE
LOAD Distinct SubField([Associate Working On ],'; ') as [Single Associate Working On],
[Practice Area ],
Resident table1 ;
join(Tab23)
LOAD
[Resource Status ],
[ Associate Name ] as [Single Associate Working On]
FROM
<sharepoint>
in above code, [Resource Status ] is coming as - (hyphen), although it has values.
Can you please suggest, what I did wrong.
Probably it found no [Associate Name ] values that matched up with the results of the Subfield() field ( [Single Associate Working On].
as a test comment out and add the drop table below. Then reload and see what you are getting for [Associate Name ] . Do the values look like [Single Associate Working On] values ?
//join(Tab23)
LOAD
[Resource Status ] ,
[ Associate Name ]
FROM
<sharepoint>
drop table table1:
Yes, they are exactly same. Both these fields contain names of associates, which I am trying to join.
Ok. Would you be able to attach the sample ?