NameValuePairLookup
Looks up a value in a series of adjacent element pairs that represent names and values.
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.
Please note that the Last Element argument takes the last Name element (LIN09 in this case), not the last Value element (LIN10).
Arguments
Lookup Value | Specify the value to compare to the Name elements in the series. |
First Element | Specify the first Name element in the series of Name/Value elements. |
Last Element | Specify the last Name element in the series of Name/Value elements. |