Skip to Content
avatar image
Former Member

UDF to add Context Change between duplicate values

Hello

Can you please help with UDF code to add context change between duplicate values. in a queue. Example as shown in the image.

capture.png (10.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jun 28, 2017 at 03:43 AM
    -1

    Hi Sudha,

    Try this by setting "All values in context"

    String s=input[0];

    for(int i=0;i<input.length;i++)

    {

    if(i!=input.length-1)

    {

    if(s.equals(input[i+1]))

    {

    result.addValue(input[i]);

    result.addValue(ResultList.CC);

    }

    else

    {

    result.addValue(input[i]);

    }

    s=input[i+1];

    }

    }

    Thanks & Regards,

    Avinash B

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 28, 2017 at 09:59 AM

    you can try this with "all values of context"

    for (int i = 0; i < input.length; i++)
    
    
    		{
    
    
    			if ((input.length > i + 1) && (input[i].equals(input[i + 1])))
    
    
    			{
    
    
    				result.addValue(input[i]);
    
    
    				result.addValue(ResultList.CC);
    
    
    			}
    
    
    			else {
    				result.addValue(input[i]);
    			}
    
    
    		}
    
    Add comment
    10|10000 characters needed characters exceeded