on 11-08-2010 12:21 PM
Hi specialists!
I have to map this structure:
source
-
segment_1 (1...n)
key_1
aaa
bbb
-
segment_2 (1...n)
key_2
ccc
ddd
-
Target:
-
segment_2
ccc
ddd
-
The condition is segment_1=>key1 = segment_2=>key2
The problem is that I need to check each segment_1 with each segment_2.
Is it possible using standard mapping functions?
Dani_K,
This can be done with standard mapping if your source.segment_1.key_1 is unique. If it is not, you could end up with a many to many mapping which would be difficult no matter how you map.
Try this:
For segment_2
source.segment_1.key_1 (right click, context, source) ---> sort --->
source.segment_2.key_2 (right click, context, source) ---> sort --->
equalsS ---> ifWithoutElse --->
source.segment_2 (then)
removeContexts (after the If Then)---> target.segment_2
For ccc
source.segment_1.key_1 (right click, context, source) ---> sort --->
source.segment_2.key_2 (right click, context, source) ---> sort --->
equalsS ---> ifWithoutElse --->
source.segment_1.ccc (right click, context, source) (then)
removeContexts (after the If Then)---> SplitByValue(Each Value) ---> target.segment_2.ccc
For ddd
source.segment_1.key_1 (right click, context, source) ---> sort --->
source.segment_2.key_2 (right click, context, source) ---> sort --->
equalsS ---> ifWithoutElse --->
source.segment_1.ddd (right click, context, source) (then)
removeContexts (after the If Then)---> SplitByValue(Each Value) ---> target.segment_2.ddd
Ideally, the segment_1.Key_1 and segment_2.key_2 are sorted before you process the message. If so, remove the sort above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Solved by UDF. Thanks for answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If the no. segment_1 (1...n) is not equal to segment_2 (1...n), mapping will fail. You can use 'mapWithDefault' before each comparison.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.