Lookup() Syntax Error in Community Edition

Hi,

I’m getting a syntax error when using a simple lookup (CSV file) in a transformation: “Syntax error on token ‘,’”. It’s referring to a comma placed after the lookup table ID in the lookup() function.

Here are the steps I’m following

1. Create a lookup in the outline tab
2. Add input, output, and reformat components
3. In the reformat mapping, map a source directly to a target
4. In a second mapping, map a source to the middle tab and edit the expression
5. Substitute ‘lookup(LookupTable0, $0.SYSTEM_FUND_SOURCE_NM).FUND_SOURCE_NM’ for the default of $0.SYSTEM_FUND_SOURCE_NM

Here is the CLT2 code from the Transform editor (Community Edition)

function integer transform() {
$0.FUND_NM = $0.FUND_NM;
$0.FUND_SOURCE_NM = lookup(LookupTable0, $0.SYSTEM_FUND_SOURCE_NM).FUND_SOURCE_NM;

return ALL;
}

Thank you,
Carl

Hello Carl,
this is syntax valid for CTL1. For CTL2 you should have


lookup(LookupTable0).get($0.SYSTEM_FUND_SOURCE_NM).FUND_SOURCE_NM

For full information see Chapter 50. CTL1 vs. CTL2 Comparison.

Thanks, the CLT2 syntax worked. -Carl