My approach was to 1) add the values together into one new Column, and then 2) Subtract each row from the one before it.
I tried some of the Column nodes such as Filter and Combine, or Join, and Group by Row…but I can’t find the right answer.
The goal is to end up with one column of data that is a time value of the gap of time between Row n and Row n+1. But time needs to be in one column because the gaps continue throughout the new day at midnight.
So at first, this is a really nice idea for a future extension of our Time Difference node.
Till now, I also would suggest something similar what you are already doing.
At first, combine the two string using the string combiner.
Use the Java Snippet to create the second time. The second time therefore should contain the string value, the first is having one row before.
Global Variable
String previous = " ";
Method Body
if($$ROWINDEX$$<1){
previous = $Date and time$;
return previous;
}
String ret = previous;
previous = $Date and time$;
return ret;
Third use 2 String to Date/Time nodes to parse your time strings to date and time values.
and at last, you can use the time difference node (option second column) to create the difference.