on 09-06-2012 9:59 AM
Hi Experts,
Can records be grouped by value?
I'm having the following scenario:
Flat file -> PI -> Idoc
The flat file looks like this:
1001;123456
1001;123457
1001;123458
1002;123459
1002;123460
1003;123461
This maps to the following XML structure:
<record>
<number>1001</number>
<value>123456</value>
<record>
<record>
<number>1001</number>
<value>123457</value>
</record>
etc.
I want to map the structure into the following(grouped by number):
<record>
<number>1001</number>
<value>
<morevalues>123456</morevalues>
<morevalues>132457</morevalues>
<morevalues>123458</morevalues>
</value>
<record>
Can someone help me with my problem?
Thanks,
Koen
PI 7.1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the help Batra. I've now got the right amount of <vale> and <morevalues> nodes. There's only the wrong value in the nodes of <morevalues>.
My scenario is slightly different then your example above:
result:
<MT_Test2>
<Record>
<Empro>
<vale>
<morevalues>123</morevalues>
</vale>
<vale>
<morevalues>124</morevalues>
</vale>
</Record>
</MT_Test2>
As I said above. I've got the right amount of <vale> records. I've only got the wrong <morevalues> values. Is there a way to get the right values in the <morevalues> nodes? I've tried the example above. But it doesn't work.
I hope the problem is clear enough. It's a little hard to explain the problem.
Hello K.,
You can also do it using XSLT. Is that an option for you? Please let me know.
Best regards,
Peter
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can handle this in mapping also.
you can use function remove context and splitbyvalue( value change) to achieve this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.