Hi JMP community,
I have a question regarding 2 data tables for which one of the data tables should have rows filled with values of columns from the other data table.
Here an example:
I have a data table (Table 1) which contains 2 columns that both have one value. In a second data table (Table 2) I have 2 columns with 9 values each. What I want is to copy the Result 1 and Result 2 column values of Table 1 to all 9 rows of Table 2. Can anyone help me correct this script? I'm using JMP 16.
Names Default To Here( 1 );
dt1 = New Table( "Table 1",
Add Rows( 1 ),
New Column( "Result 1", Numeric, Continuous, Set values( [3] ) ),
New Column( "Result 2", Numeric, Continuous, Set values( [5] ) ),
);
val1 = dt1:"Result 1"n << Get values;
val2 = dt1:"Result 2"n << Get values;
dt2 = New Table( "Table 2" );
dt2 << New Column( "Test1", Numeric, Continuous, Set values( [1, 1, 1, 1, 1, 1, 1, 1, 1] ) );
dt2 << New Column( "Test2", Numeric, Continuous, Set values( [2, 2, 2, 2, 2, 2, 2, 2, 2] ) );
dt2 << New Column( "Result 1", Numeric, Continuous, <<Set each value( val1 ) );
dt2 << New Column( "Result 2", Numeric, Continuous, <<Set each value( val2 ) );