Transformation Language

Hi,

I can ask question how I can Transformation Language in transformation.

LookupJoin

I can do it for exaple this in transformation.

${out.0.OrderID} = ${in.0.OrderID};
${out.0.CustomerID} = ${in.0.CustomerID};
${out.0.EmployeeID} = ${in.0.EmployeeID};
${out.0.EmployeeID2} = lookup(employee,${in.1.EmployeeID}.employee_ID);
${out.0.LastName} = lookup(employee,${in.1.full_name}.employee_ID);

this is your exaple in ETL Transformation Language on the webside

print_err(lookup(LKP,’ HELLO ').Age);
print_err(lookup_found(LKP));
print_err(lookup_next(LKP).Age);

Thank you

Hi !

Internal transformation language has a bit different syntax than the “script” which is converted to Java source.

This is example of transform() function used in HashJoin:

function transform(){
$OrderID := $OrderID;
$CustomerID := $CustomerID;
$EmployeeID := num2str($EmployeeID);
$EmployeeID2 := num2str($1.EmployeeID);
$LastName := concat($1.LastName,":",$1.FirstName);
}

To use lookup, it has to be defined in graph. Then you can use it something like this:

lookup( <id of the lookup>, <key par1>, <key par2>, ...).<field name>

Thus the following:

lookup(LKP,'a12','xxx').Name

Means that from lookup table with id LKP, we get record which corresponds to key ‘a12’,‘xxx’ and from such record content of Name field.

Have a look at examples package. It should give you some more info.