Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey,
I have a script:
Load
SalesPersonId,
Applymap('Table1' , SalesPersonId , 'Unknown') as SalesPersonName,
concat
Applymap('Table2' , SalesPersonId , 'Unknown') as SalesPersonName,
desk ;
I ahve Salespersonname coming form table 1 and table2 so can i concat like above script to get a single field SalesPerson with values from both table1 and table 2??
Thanks
Table1:
Mapping Load SalesPersonId, SalesPersonName From TableName;
Table2:
Mapping Load SalesPersonId, SalesPersonName From TableName;
Final:
Load
SalesPersonId,
Applymap('Table1' , SalesPersonId , 'Unknown') as SalesPersonName
FromTableName2:
Concatenate
Load
SalespersonId,
Applymap('Table2' , SalesPersonId , 'Unknown') as SalesPersonName,
From TableName3;
Load
SalesPersonId,
Applymap('Table1' , SalesPersonId , 'Unknown') & '-' & Applymap('Table2' , SalesPersonId , 'Unknown') as SalesPersonName,
desk ;
i dont think this will work becoz in this case 2 cases can be:
Unkknown-SalesPersonNAme and SalesPErsonName-Unknown
Yes
Load SalesPersonId,
Applymap('Table1' , SalesPersonId , 'Unknown') & ',' &
Applymap('Table2' , SalesPersonId , 'Unknown') as SalesPersonName,
desk ;
So you will get SalespersonName from only one of tables?
If(Applymap('Table1' , SalesPersonId , 'Unknown') = 'Unknown',
Applymap('Table2' , SalesPersonId , 'Unknown') & '-Unknown',
If(Applymap('Table2' , SalesPersonId , 'Unknown') = 'Unknown',
Applymap('Table1' , SalesPersonId , 'Unknown') & '-Unknown',
Applymap('Table1' , SalesPersonId ) & '-' & Applymap('Table2' , SalesPersonId)) as SalesPersonName
Hey,
I want that is salespersonid is present in Table1 then it should place SalesPErsonName corresponding to it else if not then ,
if it is present in table2 then it should place SalesPErsonName corresponding to it else if not then , Unknow.
Can you pls tell the whole script.
Thanks
If(Applymap('Table1' , SalesPersonId , 'Unknown') <> 'Unknown',
Applymap('Table1' , SalesPersonId ),
If(Applymap('Table2' , SalesPersonId , 'Unknown') <> 'Unknown',
Applymap('Table2' , SalesPersonId),'Unknown')) as SalesPersonName
Or even simpler/more compact:
:
Applymap('Table1' , SalesPersonId , Applymap('Table2' , SalesPersonId, 'Unknown')) as SalesPersonName
;
Thanks peter. It should work