on 08-08-2007 6:32 AM
Hi
I have to check the Total Records value with number of records in a file and even i have to check the total amount with sum of amount field..
venkat
For these time of things you can use the Global counter if standard function are not helping you. I am providing the information how we can access the global paramter and how we can manupulate it in the following example.
In the following example i am doing for increament counter.
To add the counter for each element use the folloing UDF logic
public String incrementCounter(String a,Container container){
//write your code here
if(a.equals(" "))
{
Object o = container.getGlobalContainer().getParameter("CNTR");
Integer ii;
if( o == null ) ii = new Integer(0);
else ii = (Integer)o;
ii = new Integer( ii.intValue() + 1);
container.getGlobalContainer().setParameter("CNTR", ii);
String temp = ii.toString();
return temp;
}
else return " ";
To initialise the counter follow the following UDF logic:
//write your code here
Object o = container.getGlobalContainer().getParameter("CNTR");
Integer ii = new Integer(0);;
container.getGlobalContainer().setParameter("CNTR", ii);
return "1";
Message was edited by:
Gangisetty Vijaya Bhaskarudu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Use count.map function.Also use the context as immediate.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi venkat,
I think this can be acheived by using standard f(n) count and sum. Pl try those
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
26 | |
10 | |
9 | |
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.