cancel
Showing results for 
Search instead for 
Did you mean: 

To check the no of records

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi

Use count.map function.Also use the context as immediate.

Thanks

former_member192892
Active Contributor
0 Kudos

Hi venkat,

I think this can be acheived by using standard f(n) count and sum. Pl try those