cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
mostarr
Level IV

Moving a subset of data from one table to a second table's columns with a transpose

I'm sorry for posting this again. I've posting bits and pieces of my workflow, masked, here, for help, and I'm still struggling. I have difficulty checking responses as I have had bad experiences on StackOverflow being yelled at and such for no real reason. I'm sure the scars will heal with time. Anyway, I'm around and I will get to your responses eventually.

 

To get to the technical point:

I'm trying to copy the dates some samples were run (each sample should have been run on 3 separate occasions assuming everything went well during the lab portion of the project, which I was not around for) into three separate columns of a manifest file which keeps track of ongoing metadata for our project, from what I have gleaned, such that each column is one instance of data collection. There are multiple donors each with a donor ID, and some redundancy in the data like multiple collection channels on the instrument for the "same data point" (depends on how you look at it), though I think that should be it.

 

Here is my pseudocode I have been trying to work off of and it has been rough so far. I don't know why. I'm not a seasoned computer scientist, developer, or software engineer. Any help is appreciated.

DataTypes:
	(associative array) DonorID{
		(key) Month1: (value) date1 (empty at start)
		(key) Month2: (value) date2 (empty at start)
		(key) Month3: (value) date3 (empty at start)
	}



find unique donor IDs in data
for each donor ID{
	get (i.e. subset) data keyed on donor ID;
	for Month in 1, 2, 3 (strings){
		if no date in donorID associative array{
			add date from data;
		}else if date already{
			is the date in the data table cell the same as in the associative array entry?
				if yes, do nothing (indicates different target channel)
				if no, ping user
					Multiple run dates for same data point is a problem.
		}
	}
}
Copy from data to manifest:
	loop over DonorID associative array:
		for each donorID:
			in Month 1, 2, or 3:
				add date1 2 or 3 to "Actual Month [1, 2, or 3] Stability Test Date" in manifest
				donorID is still row identifier
				date (1, 2, or 3) is now column identifier

 

10 REPLIES 10
mostarr
Level IV

Re: Moving a subset of data from one table to a second table's columns with a transpose

Now I am trying to assign the data/dates to the manifest file in the rows with the correct IDs:

 

... );
	//write(LBCM_array);
	dt_manifest << Get Rows Where(dt_manifest:ID Number for Updating Table == ID)[:Actual Data 1 Date] = data_array["data1"];
	//repeat for data 2 & 3
);

which, really, I still have no idea how to do from JSL as a beginner, so I get the error

["data1" => {}, "data2" => {}, "data3" => {}]
attempting to assign to an object that is not an L-value in access or evaluation of 'Assign' , dt_manifest << Get Rows Where(
	dt_manifest:ID Number for Updating Table == ID
)[:Actual Data 1 Date] =  /*###*/data_array["data1"] /*###*/

I have no idea what this means.


Thanks,

Mike