Hi,
I've a data table, looks something like this. I want to split each test and assign % values.
![Jackie__0-1691089344080.png Jackie__0-1691089344080.png](https://community.jmp.com/t5/image/serverpage/image-id/55549i851CDBE1E77BBFB1/image-size/medium?v=v2&px=400)
I am trying to create an Associative Array and allocate values to each tests but the results are incorrect. I am not sure what I missed
![Jackie__1-1691089533947.png Jackie__1-1691089533947.png](https://community.jmp.com/t5/image/serverpage/image-id/55551iD49CD03EEBC9CC52/image-size/medium?v=v2&px=400)
The final associative array should contain the following.
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,..................., "Currents_0" => 0.001]
Here's the jsl code. Any suggestions
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)