I am using Crystal XI and I have a list of datetime values that I need to compare. I need help in setting this up and doing the comparison.
For example I have five incidents with datetime values I need to find how many of these are concurrent incidents by comparing the next value with the previous value. So I need to load five incidents into an array then always compare the next value with all previous values to find where there are concurrent values. I only want 5 values in the array and as I go through each record I want to drop off the first value so that I may load in the next value.
Each incident has an alarmdate and lastunitcleardate I need to compare the next record alarmdate to see if it is less than or equal to the datecompleted of the previous record and this needs to be repeated for all five elements within an array.
So my data would look like this:
incident.alarmdate incident.lastunitcleardate
7/10/2013 12:30:14 7/10/2013 12:45:15
7/10/2013 12:35:10 7/10/2013 12:48:20
7/10/2013 12:36:10 7/10/2013 12:59:20
7/10/2013 12:42:10 7/10/2013 12:48:20
7/10/2013 12:45:10 7/10/2013 12:48:20
The comparison would show incident 2 would be concurrent with incident 1 since it's alarmdate is <= incident 1's lastunitcleardate, incident 3 is concurrent with incident 1 & 2 because it's alarmdate is <= incident 1's lastunitcleardate and <= incident 2's lastunitcleardate, etc.
Can someone offer me some help on this? I am stumped. I have been able to load the data into the array, but it just keeps loading element after element without stopping at five elements.
For example I have five incidents with datetime values I need to find how many of these are concurrent incidents by comparing the next value with the previous value. So I need to load five incidents into an array then always compare the next value with all previous values to find where there are concurrent values. I only want 5 values in the array and as I go through each record I want to drop off the first value so that I may load in the next value.
Each incident has an alarmdate and lastunitcleardate I need to compare the next record alarmdate to see if it is less than or equal to the datecompleted of the previous record and this needs to be repeated for all five elements within an array.
So my data would look like this:
incident.alarmdate incident.lastunitcleardate
7/10/2013 12:30:14 7/10/2013 12:45:15
7/10/2013 12:35:10 7/10/2013 12:48:20
7/10/2013 12:36:10 7/10/2013 12:59:20
7/10/2013 12:42:10 7/10/2013 12:48:20
7/10/2013 12:45:10 7/10/2013 12:48:20
The comparison would show incident 2 would be concurrent with incident 1 since it's alarmdate is <= incident 1's lastunitcleardate, incident 3 is concurrent with incident 1 & 2 because it's alarmdate is <= incident 1's lastunitcleardate and <= incident 2's lastunitcleardate, etc.
Can someone offer me some help on this? I am stumped. I have been able to load the data into the array, but it just keeps loading element after element without stopping at five elements.