表1から表2まで、同じテスト名で異なるテスト番号の要約を作成しようとしています。JMPにこれを達成するための迅速で汚い方法はありますか?ありがとう
表1
| testnum | テスト名 |
| 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 |
表2
| テスト名 | 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 |
私はあなたが何を求めているのか正確にはわかりません。 しかし、もしあなたがあなたがテーブル1からあなたのテーブル2を作成したいのであれば、これはそれをするスクリプトです。
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 );
あなたが欲しいものが違う何かであるならば、あなたはまさにあなたが欲しいものについてより多くの詳細を提供しますか?
私が提供したJSLは、任意の数のテスト名とテスト番号に対して機能します。
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 );
