Topic
  • 2 replies
  • Latest Post - ‏2012-11-20T06:16:21Z by Muk1234
Muk1234
Muk1234
22 Posts

Pinned topic Increment a value of an output field

‏2012-11-19T10:44:10Z |
Hello
I have an output field 'id' whose value depends on an input field. The id maps to a field 'refid' in a functional map. The functional map runs multiple times if there are multiple refids and generates the output accordingly. But I want the value of id to be 0 if the refid=p and 1,2,3,4...and so on if the refid='d'. So basically I want to increment the value of id each time for each refid='d' so that I can get the value of id as 1 for first refid='d' and then 2 for second refid='d' and so on. Can anyone Please help me on this. I am stuck at this issue for long. Would appreciate any help on this.Thanks in advance.
Updated on 2012-11-20T06:16:21Z at 2012-11-20T06:16:21Z by Muk1234
  • SystemAdmin
    SystemAdmin
    6184 Posts

    Re: Increment a value of an output field

    ‏2012-11-19T14:21:52Z  
    I'd suggest you use an integer as the counter's value, initialize it to 1 when the map starts, and then use GETANDSET to increment it.

    The number should be of fixed length (padded to fix length with zeroes works) and long enough to accomodate the highest possible value.

    Hope this helps

    Laurent
  • Muk1234
    Muk1234
    22 Posts

    Re: Increment a value of an output field

    ‏2012-11-20T06:16:21Z  
    I'd suggest you use an integer as the counter's value, initialize it to 1 when the map starts, and then use GETANDSET to increment it.

    The number should be of fixed length (padded to fix length with zeroes works) and long enough to accomodate the highest possible value.

    Hope this helps

    Laurent
    Thankyou Laurent. But Index($)served my purpose. Would look into GETANDSET().

    Muk