Here are a couple of ways to do what you want.
Names Default To Here( 1 );
// Pick the source data table
//dt=Open("Data Table");
dt = New Table( "Example",
Add Rows( 6 ),
New Column( "THK",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [9.5, 9.8, 10.1, 11, 11.4, 10.9] )
),
New Column( "PRE/POST",
Character,
"Nominal",
Set Values( {"POST", "POST", "POST", "PRE", "PRE", "PRE"} )
)
);
//Create New THK PRE column
dt << New Column( "THK PRE1",
Numeric,
"Continuous",
formula( If( :"PRE/POST"n == "PRE", :THK, . ) )
);
dt << New Column( "THK PRE2", Numeric, "Continuous" );
For Each Row(
If( :"PRE/POST"n == "PRE",
:THK PRE2 = :THK,
:THK PRE2 = .
)
);
If you want the THK PRE value to be a 5 as illustrated in your second example, just change the resulting value from :THK to 5
Jim