大家好 ,
我試圖連接幾個表,但結果顯示多列中的“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連接並通過上面的腳本正常工作。
我懷疑與列名相同的表變量搞砸了。