on 03-15-2011 10:38 PM
Hi Guys
I have already posted a part of this qustion but I was to fast to close it , this is the other part of it
I have the source structure .
<M>
<regsegm>
<regnr>10</regnr>
<regnr>20</regnr>
<regnr>30</regnr>
</regsegm>
<regsegm>
<regnr>40</regnr>
<regnr>50</regnr>
<regnr>60</regnr>
</regsegm>
</M>
Target
<H>
<customsegm>
<custnr></custnr>
</customsegm>
</H>
I have to create one <customsegm> for each <regsegm> , this is easy to do , but for the custnr I have to map
the first occurence of regnr of each node <regsegm> to the custnr in the created <customsegm>
for instans here in this source structure we have to create 2 <customsegm> nodes .
as following
<H>
<customsegm>
<custnr>10</custnr>
</customsegm>
<customsegm>
<custnr>40</custnr>
</customsegm>
</H>
all the regnr after the first one should not be mapped , but I am always getting them .
Hope for your help which is badly needed .
BR
You can simple map as below:
regnr -> collapseContext -
Regards
Pravesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use single line UDF:
Execution type:All values of a context, Input will be : a
result.addValue(a [ 0 ] );
regnr -> UDF -> custnr
Thanks
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
The mapping will be a little bit complicated, but the solution will be similar as was suggested in your last thread:
Here is the additional mapping
regnr(set context to M) -> collapseContext -> splitByValue:each value -> (1) useOneAsMany -> \
regsegm -> (2,3) / \
M -> index:1,1 -> sort:desc case insensitive -> collapseContext -> concat: -> splitByValue: each value -> (1) useOneAsMany -> (1) greater -> (1) ifThenElse -> splitByValue: each value -> custnr
M -> / regsegm -> (2,3) / constant:1 -> (2) / /
regnr (no context manipulation) -> collapseContext -> /
Make sure M has no context changes, otherwise the mapping will not work.
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
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.