cancel
Showing results for 
Search instead for 
Did you mean: 

Counter update

vijay_kumar133
Active Participant
0 Kudos

Hi friends,

The purpose is i need to get update a counter field in the receiver side for every input row item...

There are 2 counters in the receiver side counter1 and counter2.. but this 2 counters should be same and depends on the input row.

example if sender side as 5rows.. then for the first row counter1 should be 1 and counter2 also 1 in that way it has to increment by one...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Use count function in mapping.

input to count function will be number of rows in one context.

Wat I understood is if there are five rows then ur counter 1 and counter 2 should show "5" no for the no of rows.

let me know ur requirement clearly.

chirag

Edited by: Chirag Gohil on May 13, 2008 4:26 PM

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

You can declare the two counter variables globally and write the UDFs for counter(counter = counter + 1) and place before the target node where you want to count the segments.

former_member193376
Active Contributor
0 Kudos

Hi

You can use 2 UDF, take a global variable in each UDF, and map it to the corresponding field and update it whenever the source field occurs.

OR

You can use 2 UDF's and a single global variable. First UDF to update your global variable and then return the same in the second UDF.

Thanks

Saiyog

vijay_kumar133
Active Participant
0 Kudos

the scenario is multimapping i mean i need to map for one row to many rowsheader(1header11rows) in the receiver ok now. I need to check the condition on this 11rows on amount filed. ok if the filed is zero i need to remove entire row..

and in this context i have use counter1 and counter2 counter1 in header and counter2 in the 11rows and this two counters should have same value..for perticular sender row..

i hope it is clear now..

Former Member
0 Kudos

Hi,

You can use COUNT function.

try with INDEX function also

For each incoming value, this functuion retuns the index number of incoming value in the context, stating from the inital index and increasing by increment

Thanks,

Madhu

Former Member
0 Kudos

How you are using 2 counters in receiver side.