on 06-18-2009 12:43 AM
Hi Guys
I had a source payload as below
<row>
<ordernumber1>
<product net price>10<productnetprice>
<row>
<row>
<ordernumber1>
<product net price>10<productnetprice>
<row>
in the target the net price is at header level and the netprice value must be 10+10 = 20
<header>
<product net price>20<product net price>
<item>
<item>
<header>
Please suggest me how can i do this.
Srinivas
Thanks for your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Sorry for posting my question wrong
I must add the amount of the same order number and pass it to the target
<row>
<ordernumber1>
<product net price>10<productnetprice>
<row>
<row>
<ordernumber1>
<product net price>10<productnetprice>
<row>
<row>
<row>
<ordernumber2>
<product net price>15<productnetprice>
<row>
<row>
<ordernumber2>
<product net price>15<productnetprice>
<row>
<row>
in the target the net price is at header level and the netprice for the
order number1 value should be 10+10 = 20 and for
order number2 value should be 15+15 = 30
<header>
<ordernumber1>
<product net price>20<product net price>
<item>
<item>
<header>
<header>
<ordernumber2>
<product net price>30<product net price>
<item>
<item>
<header>
Thanks in advance
Appreciate your help.
Srinivas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srini,
your prb can be solved by writing a simple UDF:
here, ordernumber and productnetprice are the two inputs to this UDF.
int count = 0;
for(int i = 0; i < ordernumber.length ; i++)
{
count = productnetprice<i> + count;
}
result.addValue(count);
Finla mapping would be:
ordernumber1(keep row as the context) ->UDF ->productnetprice(target field under ordernumber1)
productnetprice(keep row as the context)
ordernumber2(keep row as the context) ->UDF ->productnetprice(target field under ordernumber2)
productnetprice(keep row as the context)
Let me know if it works.
Regards,
Swetha.
<row>
<ordernumber1>
<product net price>10<productnetprice>
<row>
<row>
<ordernumber1>
<product net price>10<productnetprice>
<row>
<row>
<row>
<ordernumber2>
<product net price>15<productnetprice>
<row>
<row>
<ordernumber2>
<product net price>15<productnetprice>
<row>
<row>
Use this logic:
+product net price+ (source) ----> Sum ----> product net price(target)
You seem to have two different nodes OrderNumber1 and OrderNumber2....so the above logic needs to be applied for both the nodes separately.....also keep in mind to set the Context of the product net price node to row node.
Hi Srini,
Sourcefield(ProductnetPrice) -> removeContexts(std function) -> sum(statistic fn) -> TargetField(ProductNetPrice)
Regards,
Swetha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Srinivas,
You can use the following mapping for your requirement;
Product Values (set context to higher level above row) --> Sum (function under statistic) --> target header.
Let me know for any queries.
Regards,
Murugavel.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Use node function "removeContext" and add function and map to final target filed
rgds
srini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can achieve this using XSLT mapping easily,
chek 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 |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.