Hi Georg,
It seems working fine in table column Formula. But I am not able to make it into a script. In also tried similar approach based on For loop and different column but I am not able to generate pattern of measurements to get the final results. Here is the script I am trying --
/////////////////////////////////////////////////////////////////
dt = Current Data Table();
dt << New Column( "Pattern0",
Expression,
(row_index_lst = {} ; row_Time_A = :Time_A ; row_Sample = :Sample ; threshold = 60 * 15 ;
For Each Row(
If( Abs( :Time_A - row_Time_A ) < threshold & :Sample == row_Sample,
Insert Into( row_index_lst, Row() )
)
));
(:Measurement << get values)[row_index_lst];
);
///////////////////////////////////////////
// similar approach but based on different column and For loop--
//////////////////////////////////////////////////////
dt << New Column( "Pattren",
Expression,
For( i = 1, i <= N Rows( dt ), i++,
Row_List = {};
If(
:Count == Lag( :Count, -1 ) & :Sample == Lag( :Sample, -1 ) | :Count == Lag( :Count, 1 ) &
:Sample == Lag( :Sample, 1 ),
Insert Into( Row_List, Row() )
);
(:Measurement << get values)[Row_List];
)
);
/////////////////////////////////////////////////////////////
Both are giving just empty columns. Any suggestion how can I convert your formula to a script ?
Thanks again.