Source Data (sample data provided below)
AddrLn1, AddrLn2, AddrLn3
123 main st, null, null
C/O James, 456 Corporate Rd, null
C/O Greene, HR Dept, 487 Field St
Mapping Rules
If AddrLn1 has 'c/o' or 'Attn', use AddrLn2 Else AddrLn1. this is mapped to target field EmplAddrLn1
If AddrLn2 was used for ADDRESS_LINE_1, look at AddrLn3. Skip address line with 'c/o' or 'Attn'. this is mapped to target field EmplAddrLn2
I need help with function to be used in parallel transformer and proper syntax for it.
Address Parsing Help Parallel Transformer
Moderators: chulett, rschirm, roy
Does this look right to put in transformer for target field EmplAddrLn1
Code: Select all
If Index(UpCase(Lnk_HardCodeValues_in.ADDRESS_LINE1), "C/O" or "ATTN")<> 0 Then Lnk_HardCodeValues_in.ADDRESS_LINE2 Else Lnk_HardCodeValues_in.ADDRESS_LINE1
I deleted the duplicate 'urgent' topic you opened with this exact same question in it. Let's play here.
The code you posted is fine in spirit but the syntax is wrong. You cannot use an "or" there, you need to repeat the test for each thing tested for. And with zero being equal to FALSE and non-zero equating to TRUE you can simply things.
See if that works for you.
ps. Stage variables to hold things like the UpCase'd ADDRESS_LINE would make this more efficient.
The code you posted is fine in spirit but the syntax is wrong. You cannot use an "or" there, you need to repeat the test for each thing tested for. And with zero being equal to FALSE and non-zero equating to TRUE you can simply things.
Code: Select all
If Index(UpCase(Lnk_HardCodeValues_in.ADDRESS_LINE1), "C/O") or Index(UpCase(Lnk_HardCodeValues_in.ADDRESS_LINE1), "ATTN") Then Lnk_HardCodeValues_in.ADDRESS_LINE2 Else Lnk_HardCodeValues_in.ADDRESS_LINE1
ps. Stage variables to hold things like the UpCase'd ADDRESS_LINE would make this more efficient.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Thanks chulett.
Transformer stage is not accepting that code in the derivation.Throws that red error bar
This one works though after i add comma 1 to each one. What is the 1 indicate after the address in this syntax?
If Index(UpCase(Lnk_HardCodeValues_in.ADDRESS_LINE1),"C/O", 1) OR Index(UpCase(Lnk_HardCodeValues_in.ADDRESS_LINE1),"ATTN", 1) Then Lnk_HardCodeValues_in.ADDRESS_LINE2 Else Lnk_HardCodeValues_in.ADDRESS_LINE1
Transformer stage is not accepting that code in the derivation.Throws that red error bar
This one works though after i add comma 1 to each one. What is the 1 indicate after the address in this syntax?
If Index(UpCase(Lnk_HardCodeValues_in.ADDRESS_LINE1),"C/O", 1) OR Index(UpCase(Lnk_HardCodeValues_in.ADDRESS_LINE1),"ATTN", 1) Then Lnk_HardCodeValues_in.ADDRESS_LINE2 Else Lnk_HardCodeValues_in.ADDRESS_LINE1
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: