on 05-27-2010 9:03 AM
Hi.
I have 2 fileds in my source structure that are to drive the same segment in the target structur.
I have the following example of source.
<header>
<date1/>
<date2/>
</header/
If I have a value in date1 the segment in the target shoudl be created and if i have a value in date2 the segment shoudl be created, if both of the date fields has values I should get 2 segments in the target structure.
So an target structure should look as follow with both date fileds having values.
<target>
<segment> "Driven by date1 field"
<date> "With value from date1 field"
</segment>
<segment> "Driven by date2 field"
<date> "With value from date2 field"
</segment>
</target>
BR
Kalle
Hi,
I believe you have to decide the 'segment' occurences based on the date1, date2 field values. If this is the case you can use the below UDF to achieve the same.
if (Date1[0].equals(""))
{
}
else
{
result.addValue(""Date1[0]"");
}
if (Date2[0].equals(""))
{
}
else
{
result.addValue(""Date2[0]"");
}
You need to map the date1 and date2 fields to this UDF and map it to the 'segment' and 'date' nodes in the target structure. Also while mapping to the 'date' in the target you need to add the 'SplitbyValue' standard function. Hope this solves your problem.
~Vaas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kalle,
> So an target structure should look as follow with both date fileds having values.
>
<target>
> <segment> "Driven by date1 field"
> <date> "With value from date1 field"
> </segment>
> <segment> "Driven by date2 field"
> <date> "With value from date2 field"
> </segment>
> </target>
Repeat the target node and map the accordingly.
for mapping check this link
http://www.flickr.com/photos/42898709@N07/4644438730/
Regards
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
As per my understanding your source str is okay in your target strucuture you have to duplicate the target segment in order to achieve the desired result .
create in target like this
<target>
<segment>
<date> (as you have created )
</segment>
just in message mapping right click on segemnt then you will find the option duplicate selected segment go for that option .
then mapped both the segment as per your mapping rule and you will get the desired output .
use creatIF function
In source date1 exists >creatif-> segemnt (target )
date2 exists >creatif-> segment ( mapped to duplicated segemnt in target)
if you will do mapping like this you will get the desired output I hope
Regards,
Saurabh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
right-click on "segment", chose "duplicate sub-tree" and voilà
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.