Skip to Content
avatar image
Former Member

Message Mapping : Increments

Hi Experts,

I have a requirement to add a alphabet for every next filed I same queue.
like if source exist concat Target field1 with A then Target 2 with B.

Is this can be achieved by Graphical mapping or should I have to write UDF.

Thanks in advance.

Regards,

Pooja

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Aug 21, 2017 at 09:00 AM

    Check if the below UDF(all Values of Queue) helps

    int leng = var1.length;
    String[] a = new String [] {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};
    for(int i=0;i<leng;i++)
    {
    result.addValue(var1[i]+a[i]);
    }


    Add comment
    10|10000 characters needed characters exceeded

    • The below code will start iterating from 'A' once again once the26 alphabets are completed.

      char[] alpha = new char[var1.length];
      int k = 0;
      for(int i = 0; i < var1.length; i++){
      alpha[i] = (char)(65 + (k++));
      if(k==26)
      {
      k=0;
      }
      result.addValue(var1[i]+alpha[i]);
      }

  • Aug 19, 2017 at 08:13 PM

    please explain your requirement more clearly.

    Add comment
    10|10000 characters needed characters exceeded