J'essaye de faire un résumé de numéro de test différent avec le même nom de test du tableau 1 au tableau 2. Y at-il un moyen rapide et sale dans JMP pour y parvenir? Merci
Tableau 1
| testnum | nom du test |
| 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 |
Tableau 2
| nom du test | 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 |
Je ne sais pas exactement ce que vous demandez. Mais si vous voulez créer votre table 2, à partir de la table 1, voici un script qui le fera
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 );
Si ce que vous voulez est quelque chose de différent, pourriez-vous fournir plus de détails sur ce que vous voulez exactement
La JSL que j'ai fournie fonctionnera pour un nombre quelconque de noms et de numéros de 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 );
