NameValuePairLookup - 6.3

Talend Data Mapper User Guide

EnrichVersion
6.3
EnrichProdName
Talend Big Data Platform
Talend Data Fabric
Talend Data Management Platform
Talend Data Services Platform
Talend MDM Platform
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend Studio

Name

NameValuePairLookup

Purpose

Looks up a value in a series of adjacent element pairs that represent names and values.

Description

This is a special purpose Function designed to deal with pairs of adjacent elements that represent names and values. This occurs in some EDI documents, for example in the LIN Segment of X12 EDI.

The best way to illustrate this Function is by example. The LIN Segment has the following 5 name/value pairs:

LIN01 - Product/Service ID Qualifier
LIN02 - Product/Service	ID
LIN03 - Product/Service ID Qualifier
LIN04 - Product/Service ID
LIN05 - Product/Service ID Qualifier
LIN06 - Product/Service ID
LIN07 - Product/Service ID Qualifier
LIN08 - Product/Service ID
LIN09 - Product/Service ID Qualifier
LIN10 - Product/Service ID

The Product/Service ID Qualifier is the Name, and the Product/Service ID is the Value. If we wanted to look for the Product/Service ID with the qualifier of UP, we would use the following Expression tree:

NameValuePairLookup
  Lookup Value
    Constant 'UP'
  First Element
    LIN01
  Last Element
    LIN09			

This will search through each of the Name elements LIN01, 03, 05, 07, 09 and if what of those values is UP it will return the value of the Value element which is the following corresponding element LIN02, 04, 06, 08, 10.

Note

Please note that the Last Element argument takes the last Name element (LIN09 in this case), not the last Value element (LIN10).

Return Type

Simple

Argument

Lookup Value (simple)

The value to compare to the Name elements in the series.

Argument

First Element (Sequence)

The first Name element in the series of Name/Value elements.

Argument

Last Element (Sequence)

The last Name element in the series of Name/Value elements.