on 06-10-2011 9:01 AM
Hi Gurus,
we have a following requirement;
input xml;
<root>
<material>
<id>AAA</id>
<value>10</value>
</material>
<material>
<id>AAA</id>
<value>-10</value>
</material>
<material>
<id>BBB</id>
<value>20</value>
</material>
<material>
<id>CCC</id>
<value>30</value>
</material>
</root>
As per the above source file having one duplicate record with ID = "AAA" . One of this record have a negative value (-10), so here my requirement is need to update at receiver side as below.
output.xml;
<root>
<material>
<id>BBB</id>
<value>20</value>
</material>
<material>
<id>CCC</id>
<value>30</value>
</material>
</root>
We just need to delete both record lines with same ID when one of the value is negative.
Thanks in advance,
Peter
Hello,
The above output is possible without using UDF. The mapping below assumes that the ids are already sorted as was described by your example:
Legend: rc - removeContext
fBE - formatByExample
cC - collapseContext
sBV - splitByValue VC - valueChanged EV - eachValue
For Material
value -> rC -> fBE -> sort:ascending -> cC -> sBV:EV -> greater: -1 -> ifWithoutElse -> rC -> Material
id -> rC -> sBV:VC / id -> rC -> sBV:VC -> /
For id
value -> rC -> fBE -> sort:ascending -> cC -> sBV:EV -> greater: -1 -> ifWithoutElse -> rC -> sBV:EV -> id
id -> rC -> sBV:VC / id -> rC -> sBV:VC -> /
For value
value -> rC -> fBE -> sort:ascending -> cC -> sBV:EV -> greater: -1 -> ifWithoutElse -> rC -> sBV:EV -> value
id -> rC -> sBV:VC / value -> rC -> fBE -> /
id -> rC -> sBV:VC -> /
Apologies for the shorthand notation.
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.
Hai!
You have mentioned that,
>>>>>>We just need to delete both record lines with same ID when one of the value is negative.
Whether the Value will be same. That is if u are having a id AAA=10 the value for another record with same id AAA=-10
here , the value is 10. or otherwise the value value can be anything.
Like AAA=10 and AAA=-20. here the vALUE IS DIFFERENT LKE 10 AND 20.Can U tell your requirement in detail.
Regard's
Preethi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
26 | |
10 | |
10 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.