cancel
Showing results for 
Search instead for 
Did you mean: 

UDF to Compare Two String Arrays

santosh_k3
Active Participant
0 Kudos

Hi All,

I have a requirement where I need to compare two different String Arrays which consists of dates(yyyy-MM-dd) with current date.

4 input array values to UDF(all values of context) - inputvalue , array1 , array2 , currentDate.

Below is the requirement:

If(array1[i] > currentDate and array2[i] <= currentDate )

result.addValue(inputvalues[i]);

else

result.addValue(''");

let me how can I achieve above logic using UDF.

Thanks

Sai

Accepted Solutions (0)

Answers (1)

Answers (1)

santosh_k3
Active Participant

Hi All,

Below is the code

Four input values : InpValue[] , endDate[] , posDate[] , currDate[]

for (int i = 0; i < endDate.length; i++) {
if ((endDate[i].compareTo(currDate[0]) > 0 ) && (posDate[i].compareTo(currDate[0]) <= 0 ))
result.addValue(InpValue[i]);
else{}
}

Thanks
Sai