大家好 ,
我试图连接几个表,但结果显示多列中的“losscodereason”,它假设在一列中显示我是否在jmp中手动执行。
Names Default To Here( 1 );
Final_Table="final result";
// Concatenate the tables and delete them. Add all of the tables to the first table
dtj=data table(losscode[1]);
For( i = 2, i <= nItems(losscode), i++,
dtj << concatenate(data table(losscode[i]), append to first table(1));
close(data table(losscode[i]), nosave);
);
// Rename the table to the desired name
dtj << set name(Final_Table);
错误的结果(多列)
正确的结果(全部在一列)
看来你有一个表变量(数据表的左上角框架),名称为lossreasonname,其值为CT。
在你的表中,lossreasonname列是否有一个基于表变量名的公式?
我创建了3个表Big Class,Big Class 2和Big Class 3。每个都有一个名为id的列,其值分别为1,2和3。 每个都有一个名为id的表变量。如果我使用这个脚本,这是对脚本的轻微修改
Names Default To Here( 1 );
Final_Table="final result";
losscode = {"Big Class", "Big Class 2", "Big Class 3"};
// Concatenate the tables and delete them. Add all of the tables to the first table
dtj=data table(losscode[1]);
For( i = 2, i <= nItems(losscode), i++,
dtj << concatenate(data table(losscode[i]), append to first table(1));
//close(data table(losscode[i]), nosave);
);
// Rename the table to the desired name
dtj << set name(Final_Table);或者即使我使用UI,我还会得到一个名为id2的附加列。一旦我摆脱了表变量名称id,或者你的示例lossreasonname,通过UI连接并通过上面的脚本正常工作。
我怀疑与列名相同的表变量搞砸了。