Skip to Content
0

UDF to add Context Change between duplicate values

Jun 28, 2017 at 02:46 AM

96

avatar image
Former Member

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Avinash Bandela 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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

0

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

0
Muniyappan Marasamy Jun 28, 2017 at 09:59 AM
0

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


		}

Share
10 |10000 characters needed characters left characters exceeded