cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

Cannot set value from list a variable

PhamBao
Level II

Dear all,

I try to do scripting, but find difficulty and need your help

para ={"align_ratio_2","align_ratio_1","minchaseforcef_3","maxchaseholdforce_4"};

 

1) U1L1_MEAN[1] = Col MEAN(TCB1L_U1:para[1]);

2) U1L1_MEAN[1] = Col MEAN(TCB1L_U1:align_ratio_2);
There are different outputs between 1 and 2. For further checking, the output from 2 is correct. 
Can anyone help me how to correct statement 1

Sincerely,

1 REPLY 1
txnelson
Super User


Re: Cannot set value from list a variable

Here is the way I would handle your issue.  I am using the Big Class data table for my example.

Names Default To Here( 1 );
// Open Data Table: big class.jmp
// → Data Table( "big class" )
dt = Open( "$SAMPLE_DATA/big class.jmp" );

dt << New Column( "U1L1_MEAN" );

para = {"height", "weight"};

:U1L1_Mean[1] = Col Mean( As Column( dt, para[1] ) );
Jim