on 03-24-2011 8:14 PM
I'm receiving a proxy with detail records, and I need to create a subtotals file. Here an example:
BEFORE MAPPING
<ROW>
<KOSTL>0000010300</KOSTL>
<POSID>DUMMY</POSID>
<FTE>0.51</FTE>
</ROW>
<ROW>
<KOSTL>0000010400</KOSTL>
<POSID>123</POSID>
<FTE>0.49</FTE>
</ROW>
<ROW>
<KOSTL>0000010400</KOSTL>
<POSID>DUMMY</POSID>
<FTE>0.72</FTE>
</ROW>
<ROW>
<KOSTL>0000010400</KOSTL>
<POSID>123</POSID>
<FTE>0.82</FTE>
</ROW>
<ROW>
<KOSTL>0000010300</KOSTL>
<POSID>DUMMY</POSID>
<FTE>0.18</FTE>
</ROW>
AFTER MAPPING:
<ROW>
<KOSTL>0000010300</KOSTL>
<POSID>DUMMY</POSID>
<FTE>0.59</FTE>
</ROW>
<ROW>
<KOSTL>0000010400</KOSTL>
<POSID>123</POSID>
<FTE>1.31</FTE>
</ROW>
<ROW>
<KOSTL>0000010400</KOSTL>
<POSID>DUMMY</POSID>
<FTE>0.72</FTE>
</ROW>
How do I create a new record for all unquie combinations of KOSTL and POSID? And total the FTE field for each line? Can this be done in a message mapping?
Hello,
How do I create a new record for all unquie combinations of KOSTL and POSID? And total the FTE field for each line? Can this be done in a message mapping?
Yes, very much possible with or without UDF. See sample mapping below without using UDF:
For ROW:
KOSTL(set context to row) -> concat: -> sort: case insensitive ascending -> splitByValue:valueChanged -> collapseContext -> ROW
POSID(set context to row) -> /
For KOSTL:
KOSTL(set context to row) -> concat: ----------------> sortByKey: case insensitive ascending -> formatByExample -> collapseContext -> splitByValue:eachValue -> KOSTL
POSID(set context to row) -> / KOSTL(set context to row) ->/ /
/
KOSTL(set context to row) -> concat: -> sort: case insensitive ascending -> splitByValue:valueChanged -> /
POSID(set context to row) -> /
For POSID:
KOSTL(set context to row) -> concat: ----------------> sortByKey: case insensitive ascending -> formatByExample -> collapseContext -> splitByValue:eachValue -> POSID
POSID(set context to row) -> / POSID(set context to row) ->/ /
/
KOSTL(set context to row) -> concat: -> sort: case insensitive ascending -> splitByValue:valueChanged -> /
POSID(set context to row) -> /
For FTE:
KOSTL(set context to row) -> concat: ----------------> sortByKey: case insensitive ascending -> formatByExample -> sum -> splitByValue:eachValue -> FTE
POSID(set context to row) -> / FTE(set context to row) ->/ /
/
KOSTL(set context to row) -> concat: -> sort: case insensitive ascending -> splitByValue:valueChanged -> /
POSID(set context to row) -> /
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 |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.