Skip to Content
avatar image
Former Member

Count fields in Mapping

Hi all,

We are using PI7.0, we have a requirement where we need to count the number of fields occurring in the target and that count has to be given in one of the field. The target elements vary according to the input. To be clear, for example

If 5 fields are formed in the target, the 5th field should have the number 5 as the output.

Can this be achieved in message mapping ?

If so, kindly help me .

Regards,

Sherin Jose

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jun 18, 2010 at 09:27 AM

    use index function

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 18, 2010 at 09:31 AM

    >> Can this be achieved in message mapping ?

    Yes... Use index function as sugested by Stefan

    Regards,

    Abid

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 18, 2010 at 12:14 PM

    You can use a UDF, have a global variable as a counter and use it in your UDF to count the occurances.. Ideally its possible to do it with graphical functions.

    THanks

    S

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi

      Create a global variable under the parent segment & map counter funtion to it.

      You can map this global variable to which ever field u want to.

      -

      Srikanth Srinivasan