Here is a script that first creates the 2 data tables you displayed in your first entry, followed by the code that copies the limits from the limits table and applies them to each column in the main table
Names Default To Here( 1 );
dtMain = New Table( "Main",
Add Rows( 20 ),
New Column( "Player",
Character,
"Nominal",
Set Values(
{"a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "b", "b", "b", "b", "b", "b", "b", "b", "b", "b"}
)
),
New Column( "Zone",
Character,
"Nominal",
Set Values(
{"North", "North", "North", "North", "North", "North", "North", "North", "North", "North", "South",
"South", "South", "South", "South", "South", "South", "South", "South", "South"}
)
),
New Column( "Badminton",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [2, 3, 4, 5, 2, 4, 4, 4, 9, 5, 1, 2, 4, 3, 6, 2, 5, 6, 7, 6] )
),
New Column( "Table Tennis",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [2, 6, 6, 2, 5, 5, 3, 5, 7, 0, 3, 4, 7, 6, 4, 2, 8, 5, 2, 4] )
),
New Column( "Lawn Tennis",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [3, 3, 5, 2, 6, 6, 6, 2, 6, 5, 7, 7, 8, 3, 5, 2, 6, 2, 3, 6] )
)
);
dtLimits = New Table( "Limits",
Add Rows( 3 ),
New Column( "Game",
Character,
"Nominal",
Set Values( {"Badminton", "Table Tennis", "Lawn Tennis"} ),
Set Display Width( 128 )
),
New Column( "Reference Line 1", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [7, 8, 6] ) ),
New Column( "Reference Line 2", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1, 2, 3] ) )
);
// Here is the code that sets the Response Limits
For( i = 1, i <= N Rows( dtLimits ), i++,
If( Try( (Column( dtMain, (Column( dtLimits, "Game" )[i]) )) << get name, "" ) != "",
Eval(
Substitute(
Expr(
Column( dtMain, Column( dtLimits, "Game" )[i] ) << set property(
"response limits",
{Goal( Maximize ), Lower( __Low__, 1 ), Upper( __up__, 1 ), Importance( 1 ),
Show Limits( 1 )}
)
),
Expr( __Low__ ), dtLimits:Reference Line 2[i],
Expr( __Up__ ),
dtLimits:Reference Line 1[i]
)
)
)
);
Jim