lookup(fieldname, matchfieldname, matchfieldvalue [, tablename])
Returns the value of fieldname corresponding to the first occurrence of the value matchfieldvalue in the field matchfieldname.
Fieldname, matchfieldname and tablename must be given as strings (e.g. quoted literals).
The search order is load order unless the table is the result of complex operations such as joins, in which case the order is not well defined.
Both fieldname and matchfieldname must be fields in the same table, specified by tablename. If tablename is omitted the current table is assumed.
If no match is found, null is returned.
Consider that you have Customer Table having customer information and Sales Table having customer name only.
You want to lookup customer id or customer country in sales table.
Load Text(ID) as ID, Name, Country Inline
ID, Name, Country
001, A, Germany
002, B, Italy
003, C, France
004, D, Poland
005, F, Spain
Load *, Lookup('Country','Name', CustomerName, 'Customer') as Country Inline
Drop Table Customer;
There are another function.... ApplyMap which is used and more fast than lookup but mapping table should have only two columns. One for reference and second as an end result.
Instead of ApplyMap and Lookup, you can join the table also, but sometimes for big database your application get slower and response time increased, so above two functions are handy.
Hope this help....