This situation is weird. This script builds the formula:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Diabetes.jmp" );
col = dt << New Column( "test" );
lo = 6;
hi = 9;
f = Expr( Add() );
For( c = lo, c <= hi, c++,
r = (dt << Get Column Reference( Eval List( { Column( dt, c ) << Get Name } ) ))[1];
Insert Into( f, r );
);
Eval(
Substitute(
Expr( col << Set Formula( fff ) ),
Expr( fff ),
Name Expr( f )
)
);
But it does not evaluate. Yet it works if I examine the preview in the formula editor.
![Capture.JPG Capture.JPG](https://community.jmp.com/t5/image/serverpage/image-id/21680iE1F6D538EDC5D7A7/image-size/large?v=v2&px=999)
Anyway, why use a formula when you don't want to?
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Diabetes.jmp" );
col = dt << New Column( "test" );
lo = 6;
hi = 9;
sum = J( N Row( dt ), 1, 0 );
For( c = lo, c <= hi, c++,
sum += Column( dt, c ) << Get As Matrix;
);
col << Set Values( sum );