on 03-30-2010 1:28 PM
Hi Experts,
I have a structure that looks like this,
LINE
line1
item1
item2
line2
item1
item2
line3
item1
item2
and the target structure will look like this,
SEGMNT
line1
item1
item2
line2
item1
item2
line3
item1
item2
Now, if item2 in line1 of source is missing then I want to map item2 of line2 of source to item2 of line1 of target. Please let me know how to go about this?
Thanks,
Dhawal
i have done it with the standard functions.
How can i put a picture in here?
maybe this link works.
http://www.flickr.com/photos/48896701@N02/4479626478/sizes/o/
Edited by: Franz Schwarz on Mar 31, 2010 7:42 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try this:
[http://s3.directupload.net/file/d/2115/2azvy7lk_jpg.htm]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thats ok, but is this also possible:
Source Payload
<class>
<student>
<name>ABC</name>
<grade></grade>
<student>
<name>XYZ</name>
<grade>A</grade>
<student>
<name>123</name>
<grade></grade>
<student>
<name>PQR</name>
<grade>B</grade>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dhawal,
Is your requirement only for the 'item2' field of 'line1' node in target?
If so, what has to be mapped to target, if 'item2' field of 'line1' node in source is available?
Regards,
Zameer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I will add payloads here to explain the situation in more detail.
Source Payload
<class>
<student>
<name>ABC</name>
<grade></grade>
</student>
<student>
<name>XYZ</name>
<grade>A</grade>
</student>
<student>
<name>PQR</name>
<grade>B</grade>
</student>
</class>
Current Target Payload
<Target_class>
<student>
<name>ABC</name>
<grade></grade>
</student>
<student>
<name>XYZ</name>
<grade>A</grade>
</student>
<student>
<name>PQR</name>
<grade>B</grade>
</student>
</Target_class>
Required Target Payload
<Target_class>
<student>
<name>ABC</name>
<grade>A</grade> // Here, grade A shoube be picked up from next student (XYZ)
</student>
<student>
<name>XYZ</name>
<grade>A</grade>
</student>
<student>
<name>PQR</name>
<grade>B</grade>
</student>
</Target_class>
Now I understand that I need to write UDF for this, the question is HOW? Please guide me in this direction.'
Thanks,
Dhawal
hi,
it's difficult, but possible.
you have to do it with context changes and split by value.
maybe i'll can give you a example.
i will provide it, if i have it.
regards
franz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dhawal.
Can you explain more clearly.
line1,line2,line3 are in the same level.?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
line1, line2, line3 are at same level. In fact these are the exact same structures, or I should say these are instances of the same structure. Ok, I will refine my question. I will give a more relalistic view of my source structure
CLASS
student
name = 'ABC'
grade = blank
student
name = 'XYZ'
grade = 'A'
.
.
.
Now my requirement is that I want to assign grade of XYZ to grade of ABC. There might be few more 'student' structures below these two but I want to get grade value from second structure itself, i.e. grade of XYZ
Thanks,
Dhawal
Hi,
>>>Now, if item2 in line1 of source is missing then I want to map item2 of line2 of source to item2 of line1 of target. Please let me know how to go about this?
this requirement is not clear
what if you miss the least item2 in line3 ? then the first one ? or none ? or what?
anyway you can put anything you need inside a UDF but at first you need to have a complete logic
it may not be possible without writing some code in an UDF
Regards,
Michal Krawczyk
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.