cancel
Showing results for 
Search instead for 
Did you mean: 

UDF to add Context Change between duplicate values

Former Member
0 Kudos

Hello

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Muniyappan
Active Contributor
0 Kudos

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]);
			}


		}

former_member216164
Participant
0 Kudos

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

Muniyappan
Active Contributor
0 Kudos

please check your code. it is ignoring the last value.

former_member216164
Participant
0 Kudos

Checking the last value doesn't matter because we need not insert any context change after last value.