Sto cercando di fare un riepilogo di un numero di test diverso con lo stesso nome di test dalla Tabella 1 alla Tabella 2. C'è un modo veloce e sporco in JMP per raggiungere questo obiettivo? Grazie
Tabella 1
| testnum | nometest |
| T17561 | Ana_Limiter_vdhf_ATE_Chara_LA @ LA-LB |
| T17562 | Ana_Limiter_vdhf_ATE_Chara_LA @ LA-LB |
| T17563 | Ana_Limiter_vdhf_ATE_Chara_LA @ LA-LB |
| T17564 | Ana_Limiter_vdhf_ATE_Chara_LA @ LA-LB |
| T17565 | Ana_Limiter_vdhf_ATE_Chara_LA @ LA-LB |
| T17566 | Ana_Limiter_vdhf_ATE_Chara_LA @ LA-LB |
| T17567 | Ana_Limiter_vdhf_ATE_Chara_LA @ LA-LB |
| T17621 | Ana_PowerRegulator_ATE_Chara @ LA |
| T17622 | Ana_PowerRegulator_ATE_Chara @ LA |
| T17623 | Ana_PowerRegulator_ATE_Chara @ LA |
| T17624 | Ana_PowerRegulator_ATE_Chara @ LA |
Tavolo 2
| nometest | testnum |
| Ana_Limiter_vdhf_ATE_Chara_LA @ LA-LB | T17561, T17562, T17563, T17564, T17565, T17566, T17567 |
| Ana_PowerRegulator_ATE_Chara @ LA | T17621, T17622, T17623, T17624 |
Non sono esattamente sicuro di ciò che stai chiedendo. Ma, se vuoi creare la tua tabella 2, dalla tabella 1, ecco uno script che lo farà
names default to here(1);
// Create the sample table
dt = New Table( "Example",
Add Rows( 11 ),
New Script(
"Source",
Data Table( "Untitled 13" ) << Split(
Split By( :Column 2 ),
Split( :Column 1 ),
Sort by Column Property
)
),
New Column( "testnum",
Character,
"Nominal",
Set Selected,
Set Values(
{"T17561", "T17562", "T17563", "T17564", "T17565", "T17566", "T17567",
"T17621", "T17622", "T17623", "T17624"}
),
Set Display Width( 68 )
),
New Column( "testname",
Character,
"Nominal",
Set Values(
{"Ana_Limiter_vdhf_ATE_Chara_LA@LA-LB",
"Ana_Limiter_vdhf_ATE_Chara_LA@LA-LB",
"Ana_Limiter_vdhf_ATE_Chara_LA@LA-LB",
"Ana_Limiter_vdhf_ATE_Chara_LA@LA-LB",
"Ana_Limiter_vdhf_ATE_Chara_LA@LA-LB",
"Ana_Limiter_vdhf_ATE_Chara_LA@LA-LB",
"Ana_Limiter_vdhf_ATE_Chara_LA@LA-LB", "Ana_PowerRegulator_ATE_Chara@LA",
"Ana_PowerRegulator_ATE_Chara@LA", "Ana_PowerRegulator_ATE_Chara@LA",
"Ana_PowerRegulator_ATE_Chara@LA"}
),
Set Display Width( 244 )
)
); // End of Example table creation
// Create the new summary data table
dtTrans = dt << Transpose(
columns( :testnum ),
By( :testname ),
Output Table( "Transpose" )
);
// Get rid of the not needed column called "Label"
dtTrans << delete columns("Label");
// Get a list of the columns in the data table
colNames = dtTrans << get column names(string);
// Get rid of the first column so the list only contains the transposed columns
colNames = remove(colNames,1,1);
// Create the new testnum column
dtTrans << New Column( "testnum", character );
// Loop through all of the rows in the table and create the concatenated column
For( theRow = 1, theRow <= N Rows( dtTrans ), theRow++,
:testnum[theRow] = :Row 1[theRow];
For( theCol = 2, theCol <= N Items( colNames ), theCol++,
If( Column( colNames[theCol] )[theRow] != "",
:testnum[theRow] = :testnum[theRow] || ", " || Char( Column( colNames[theCol] )[theRow] )
)
);
);
// Delete the unnecessary columns
dtTrans << delete columns( colNames );
Se ciò che desideri è qualcosa di diverso, ti preghiamo di fornire maggiori dettagli su ciò che desideri
Il JSL che ho fornito funzionerà con qualsiasi numero di nomi di test e numeri di test
Names Default To Here( 1 );
dt = New Table( "Example", New Column( "testname", character ), New Column( "testnum", character ) );
For( i = 1, i <= 50, i++,
tnam = "Testname" || Char( i );
kstart = Random integer( 1, 5 );
For( k = kstart, k <= Random integer( 1, 25 + kstart ), k++,
dt << add rows( 1 );
dt:testname[N Rows( dt )] = tnam;
dt:testnum[N Rows( dt )] = "T" || Char( k );
);
);
// Create the new summary data table
dtTrans = dt << Transpose(
columns( :testnum ),
By( :testname ),
Output Table( "Transpose" )
);
// Get rid of the not needed column called "Label"
dtTrans << delete columns("Label");
// Get a list of the columns in the data table
colNames = dtTrans << get column names(string);
// Get rid of the first column so the list only contains the transposed columns
colNames = remove(colNames,1,1);
// Create the new testnum column
dtTrans << New Column( "testnum", character );
// Loop through all of the rows in the table and create the concatenated column
For( theRow = 1, theRow <= N Rows( dtTrans ), theRow++,
:testnum[theRow] = :Row 1[theRow];
For( theCol = 2, theCol <= N Items( colNames ), theCol++,
If( Column( colNames[theCol] )[theRow] != "",
:testnum[theRow] = :testnum[theRow] || ", " || Char( Column( colNames[theCol] )[theRow] )
)
);
);
// Delete the unnecessary columns
dtTrans << delete columns( colNames );
