Hi,
I have a LOOKUP function where I would like to examine an EDI X12 315 file and pickout the R4 segment when the location code in the R4 and the location name match the code and name in the B4 segment. In case there is no match found, i want to do the search only on the location code and finally if even that isnt found, just the location name. My function is as below:
=EITHER(LOOKUP(PortFunctionCd Element:R4 Segment:LoopR4 QO315:Inbound315, (StatusLoc Element:B4 Segment:Inbound315 = LocID Element:Loc MComposite:R4 Segment:LoopR4 QO315:Inbound315) & (LocID Element:LocID MComposite:B4 Segment:Inbound315) = (PortName Element:R4 Segment:LoopR4 QO315:Inbound315)),
LOOKUP(PortFunctionCd Element:R4 Segment:LoopR4 QO315:Inbound315, StatusLoc Element:B4 Segment:Inbound315 = LocID Element:Loc MComposite:R4 Segment:LoopR4 QO315:Inbound315),
LOOKUP(PortFunctionCd Element:R4 Segment:LoopR4 QO315:Inbound315, LocID Element:LocID MComposite:B4 Segment:Inbound315 = PortName Element:R4 Segment:LoopR4 QO315:Inbound315))
The function doesnt work when I have the following data in the input i.e. it should use the second R4. Instead it seems to pick up the first R4 even if one of the two conditions match. Ideally it should execute condition 1 through all the R4's and then move to condition 2 if nothing satisfies condition 1.
B4^^^I^20051010^1011^USSAV^MOFU^055790^L^4300^SAVANNAH^CI^6~
N9^BM^MOLU603934970A~
N9^4F^5156510~
N9^BN^603934970A~
Q2^9134672^^^^^^^^113S^^^L^ZIM SAO PAULO I~
R4^Z^UN^USSSV^SAVANNAH~
DTM^243^20051005^0741~
R4^L^UN^USSAV^SAVANNAH^US~
DTM^245^20051013^1700~
R4^D^UN^BRRIG^RIO GRANDE^BR~
DTM^245^20051031^2340^LT~
R4^M^UN^UYMVD^MONTEVIDEO^UY~
Any ideas would be helpful.
I have a LOOKUP function where I would like to examine an EDI X12 315 file and pickout the R4 segment when the location code in the R4 and the location name match the code and name in the B4 segment. In case there is no match found, i want to do the search only on the location code and finally if even that isnt found, just the location name. My function is as below:
=EITHER(LOOKUP(PortFunctionCd Element:R4 Segment:LoopR4 QO315:Inbound315, (StatusLoc Element:B4 Segment:Inbound315 = LocID Element:Loc MComposite:R4 Segment:LoopR4 QO315:Inbound315) & (LocID Element:LocID MComposite:B4 Segment:Inbound315) = (PortName Element:R4 Segment:LoopR4 QO315:Inbound315)),
LOOKUP(PortFunctionCd Element:R4 Segment:LoopR4 QO315:Inbound315, StatusLoc Element:B4 Segment:Inbound315 = LocID Element:Loc MComposite:R4 Segment:LoopR4 QO315:Inbound315),
LOOKUP(PortFunctionCd Element:R4 Segment:LoopR4 QO315:Inbound315, LocID Element:LocID MComposite:B4 Segment:Inbound315 = PortName Element:R4 Segment:LoopR4 QO315:Inbound315))
The function doesnt work when I have the following data in the input i.e. it should use the second R4. Instead it seems to pick up the first R4 even if one of the two conditions match. Ideally it should execute condition 1 through all the R4's and then move to condition 2 if nothing satisfies condition 1.
B4^^^I^20051010^1011^USSAV^MOFU^055790^L^4300^SAVANNAH^CI^6~
N9^BM^MOLU603934970A~
N9^4F^5156510~
N9^BN^603934970A~
Q2^9134672^^^^^^^^113S^^^L^ZIM SAO PAULO I~
R4^Z^UN^USSSV^SAVANNAH~
DTM^243^20051005^0741~
R4^L^UN^USSAV^SAVANNAH^US~
DTM^245^20051013^1700~
R4^D^UN^BRRIG^RIO GRANDE^BR~
DTM^245^20051031^2340^LT~
R4^M^UN^UYMVD^MONTEVIDEO^UY~
Any ideas would be helpful.