on 08-17-2008 10:14 AM
Hi,
I have a single Amount field in each record. and there are multiple records. i want to add them using UDF and not using message mapping standard function 'SUM'. How do i write the UDF?
Thanks
Hi,
Pls use the above UDF like this. It's working fine.
amount->remove context(node function)->add_amount->split by value(node function)->target
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
The above code in UDF will work fine...but along with it add below statement after
result.addValue(c);
result.addContextChange();
This will allow you to add this Amount field per record...
Thanks
swarup
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
use the cache parameter as context.
amount-->add-->target
public void add_amount(String[] a,ResultList result,Container container)
{
String c;
int k;
int j = 0;
for(int i = 0; i <= a.length; i++)
{
k = Integer.parseInt(a<i>);
j = j+k;
}
c = String.valueOf(j);
result.addValue(c);
Edited by: malini balasubramaniam on Aug 18, 2008 11:11 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.