Hi,
We have a requirement to get the first and last values from one element for target 2 elements.
I wrote a udf for get the first value as below
public void getItem1(String[] a, ResultList output1, Container container) throws StreamTransformationException{
for(int i=0;i<a.length;i++)
{
if(a[i].length()>0)
{
String str1[]= a[i].split("\\,");
output1.addValue(str1[0]);
}
else
{
output1.addValue("");
}
}
and it is working fine.Now i want to get the last value as output,
Example:
In a element we getting some values with separate comma like 455657656,22323,76576,71236,98098,.......,67676.
I want to get the last value after the comma 67676 as a output.
Can you please help me on this.
Thanks in advance.