There were 2 errors.....
1. I reversed the logic of the If() function I had specified....I had "!=" and it needs to be "==".
2. The colNames references in the color cells() had to reference the specific column....my error too
I have also cleaned up your code a bit......nothing major,
Names Default To Here( 1 );
dt1 = Open(
Pick File(),
columns(
Column( "IM#", Character, "Nominal" ),
Column( "LREQ", Numeric, "Continuous", Format( "Best", 10 ) ),
Column( "DATE/TIME", Character, "Nominal" ),
Column( "T(x)", Character, "Nominal" ),
Column( "BOARD", Numeric, "Continuous", Format( "Best", 10 ) ),
Column( "CHANNEL", Numeric, "Continuous", Format( "Best", 10 ) ),
Column( "DATA", Numeric, "Continuous", Format( "Best", 10 ) )
),
Import Settings(
End Of Line( CRLF ),
End Of Field( Tab, Comma, CSV( 0 ) ),
Strip Quotes( 1 ),
Use Apostrophe as Quotation Mark( 0 ),
Scan Whole File( 1 ),
Treat empty columns as numeric( 0 ),
CompressNumericColumns( 0 ),
CompressCharacterColumns( 0 ),
CompressAllowListCheck( 0 ),
Labels( 1 ),
Column Names Start( 1 ),
Data Starts( 2 ),
Lines To Read( "All" ),
Year Rule( "20xx" )
)
) << Set Name( "DT1" );
Data Table( "DT1" ) << Sort(
By( :BOARD, :CHANNEL, :Name( "T(x)" ) ),
Order( Ascending, Ascending, Ascending ),
replace table
) << New Column( "T00 Value",
formula( If( :Name( "T(x)" ) == "T00", :Data, :T00 Value[Row() - 1] ) )
) << New Column( "Diff",
formula( (:Data - :T00 Value) / :T00 Value ),
Format( "Percent" )
);
dt = Data Table( "DT1" ) << Split(
Split By( :Name( "T(x)" ) ),
Split( :DATA, :Name( "Diff" ) ),
Group( :IM#, :LREQ, :BOARD, :CHANNEL ),
Remaining Columns( Drop All ),
Output Table Name( "DT2" )
);
Close( Data Table( "DT1" ), No Save );
//Names Default To Here( 1 );
//dt = Current Data Table();
colNames = dt << get column names( numeric, string );
For( i = 1, i <= N Items( colNames ), i++,
If( Left( colNames[i], 4 ) == "Diff",
Column( dt, colNames[i] ) << color cells(
"Red",
dt << get rows where( As Column( dt, colNames[i] ) >= .1 )
)
)
);
Jim