Mike,
I remain lost a bit on why you want to use an Associative Array, but regardless, I believe the below code will move into the array, the date values for the 3 measurement rows for each ID. I made up some data that I hope resembles the layout of your data. I am only guessing based upon your statements and code usage.
Here is the script. The above data table is generated at the beginning of the script, so the guts of your code, with my modifications comes below the data table generation.
Names Default To Here( 1 );
dt_data = New Table( "Example",
Add Rows( 6 ),
New Column( "ID", Character, "Nominal", Set Values( {"A", "A", "A", "B", "B", "B"} ) ),
New Column( "Run Date",
Numeric,
"Continuous",
Format( "m/d/y", 12 ),
Input Format( "m/d/y" ),
Set Values( [3692304000, 3694982400, 3697401600, 3700080000, 3702672000, 3705350400] )
),
New Column( "TimePoint", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [., ., ., ., ., .] ) )
);
//dt_manifest = Open( "[filepath, no issues here]" );
Summarize( dt_data, IDs = by( :ID ) ); //this finds all the unique IDs in the data file, which we will need //[no issues here]
//First, populate the temporary data structure--associative array--from the data file which we will then copy over to the manifest file.
For( i = 1, i <= N Items( IDs ), i++,
ID = IDs[i];
theRows = dt_data << get rows where( :ID == ID );
data_array = Associative Array( {"data1", "data2", "data3"}, {{}, {}, {}} );
k=0;
For( data = data_array << First, !Is Empty( data ), data = data_array << Next( data ), //looping through data_array's keys is clunky but done this way in JMP
k++;
show( ID ); //just a check; works
data_array[data] = :Run date[theRows[k]];
//...continue with further code to transfer from LBCM_array to manifest
);
show(data_array);
);
The results of the code is listed in the log
ID = "A";
ID = "A";
ID = "A";
data_array = ["data1" => 3692304000, "data2" => 3694982400, "data3" => 3697401600];
ID = "B";
ID = "B";
ID = "B";
data_array = ["data1" => 3700080000, "data2" => 3702672000, "data3" => 3705350400];
The numbers in the data_array are the numerical values for the Run Dates.
Jim