JSL script if statement then Delete ColumnHi,
I am new to JSL script. How do I write in JSL script for the scenario below:
If last 10 rows in column A <= to last 10 rows in column B, then delete column C and column E else delete column D and column F. The values in the last 10 rows within columns A & B are always the same. Can anyone help to translate this into JSL script?

Re: JSL script if statement then Delete ColumnIf I am interpreting your request properly, the following simple script will give you what you want
Names Default To Here( 1 );
dt = Current Data Table();
// Initialize a counter
count = 0;
// Loop through the last 10 rows and count
// the number of times :A<=:B
For( i = N Rows( dt ) - 9, i <= N Rows( dt ),
i++,
If( :A[i] <= :B[i], count++ )
);
// Handle the 2 scenarios for which columns to delete
If( count == 10,
dt << delete columns( {"C", "E"} ),
dt << delete columns( {"D", "F"} )
);