Hello,
I am working on setting up a script. One of the steps is for us to determine if the 'Timestamp' is within 30 minutes of the row above or below, with them in sequential order by UCN. Obviously, I need this to include the date and time. Below is the script/formula I am using. But when I do it, it is only looking at times and not taking into account the UCN or the date. You can see in my '30 minutes' column that it is not identifying right.
This is set up so that the UCNs are those within 5 digits of each other. But then I need it to determine if those UCN's have a timestamp within 30 minutes of the ones that are within the 5 digits. Hopefully that makes sense. So if you look at rows 12 and 13, it says they are a match based on the timestamp, but they are not because they have different center codes and the UCNs are not 5 digits apart. Row 11 and 12 are within 5 digits for the UCN, but the time is more than 30 minutes apart, so it should not be identifying as a '1'/red in the 'time within 30' column.
// New column: Time within 30
Data Table("Time within 30 minutes") << New Column("Time within 30",
Numeric,
"Continuous",
Format("Best", 12),
Formula(
If(
Dif(Num(:Unit Entry Timestamp), 1) <= 30 | Abs(Dif(Num(:Unit Entry Timestamp), -1))
<= 30,
1,
0
)
)
) << Move Selected Columns({:Time within 30}, after(:Positive or Negative));
// Change column info: Time within 30
Data Table("Time within 30 minutes"):Time within 30 <<
Set Property("Value Colors", {0 = 2, 1 = 3}) << Color Cell by Value(1);