If I am interpreting your expansion request correctly, your data table would now look like this?
Using the method that I originally proposed, the script would have a couple of minor changes:
Names Default To Here( 1 );
dt = Current Data Table();
// Create a data table with just screen values
dt << select where( :day == "screen" );
dtscreen = dt << subset( selected rows(1 ), selected columns(0 ) );
dtscreen << delete columns( "day" );
dtscreen:Value << set name( "Screen Value" );
dtscreen:Value 2 << set name( "Screen Value 2" );
// Combine the data back together
dt << Update( With( dtscreen ), Match Columns(:subject = :subject ) );
Close( dtscreen, nosave );
// Make the final calculation
dt << New Column( "% dif from screen", formula((:Value - :screen value) / :Screen Value ), Format( "Percent", 7, 2 ));
dt << New Column( "% dif from screen 2", formula((:Value 2 - :screen value 2) / :Screen Value 2 ), Format( "Percent", 7, 2 ));
This would give you a final table looking like:
There is an advantage in using the methodology that MS proposed, in that it can be accomplished just by specifying a formula for the new column. However, it does rely on determining the Screen row position , which may not be a valid assumption when you are using this with real data.
Jim