CIAO,
Ho una tabella di dati, assomiglia a questo. Voglio dividere ogni test e assegnare valori percentuali.

Sto cercando di creare un array associativo e allocare valori a ciascun test, ma i risultati non sono corretti. Non sono sicuro di cosa mi sono perso

L'array associativo finale dovrebbe contenere quanto segue.
new_aa = [" Currents_A" => 0.003 " Currents_B" => 0.003, " Currents_C" => 0.003, "Volts_A" => 0.003, "Votls_B" => 0.003, "Volts_1" => 0.002,...... ............., "Correnti_0" => 0.001]
Ecco il codice jsl. Eventuali suggerimenti
Names Default To Here( 1 );
dt = Data Table( "dt" );
aa = Associative Array( Column( dt, 1 ) << get values, Column( dt, 3 ) << get values );
fail_test = fa << Get Keys;
split_tests = {};
For Each( {test, index}, fail_test,
Insert Into( split_tests, Words( test, "," ) )
);
For( i = 1, i <= N Items( split_tests ), i++,
new_aa = Associative Array( split_tests, If( Contains( aa, split_tests[i] ), aa[split_tests[i]] ) )
);
show(new_aa)Ecco cosa farei per ottenere l'array associativo che stai cercando
Names Default To Here( 1 );
dt = Data Table( "dt" );
// Get all columns
allOrigColumnsList = dt << get column names( string );
// Move individual elements of the column, to individual columns
dt << Text To Columns( delimiter( "," ), columns( :paretotop20 ) );
// Find all new columns
newColList = dt << get column names( string );
For( i = N Items( newColList ), i >= 1, i--,
If( Contains( allOrigColumnsList,
newColList[i]),
Remove From( newColList, i, 1 )
)
);
dtStack = Data Table( "dt" ) << Stack(
columns( eval(newColList) ),
Source Label Column( "Label" ),
Stacked Data Column( "Data" ),
"Non-stacked columns"n( Keep( :"% of Total"n ) ),
Output Table( "Untitled 60.jmp" )
);
dtStack << select where(:Data == "" );
dtStack << delete rows;
aa = Associative Array( Column( dtStack, 3 ) << get values, Column( dtStack, 1 ) << get values );