이 게시물은 커뮤니티 토론 영역이 아닌 토론에 있어야 합니다.
이를 수행하는 더 좋은 방법이 있을 가능성이 높지만 다음은 예제 데이터와 함께 작동하는 것처럼 보이는 무거운 솔루션을 스크립팅하는 것입니다.
Names Default To Here(1);
//Example datatable
dt = New Table("Q OF THE DAY",
Add Rows(5),
New Column("ID", Character(1), "Nominal", Set Values({"A", "B", "C", "D", "E"}), Set Display Width(38)),
New Column("V1", Numeric, "Continuous", Format("Best", 12), Set Values([1, 0, 1, 0, 0]), Set Display Width(38)),
New Column("V2", Numeric, "Continuous", Format("Best", 12), Set Values([1, 1, 1, 0, 0]), Set Display Width(38)),
New Column("V3", Numeric, "Continuous", Format("Best", 12), Set Values([0, 0, 1, 0, 0]), Set Display Width(38)),
New Column("V4", Numeric, "Continuous", Format("Best", 12), Set Values([1, 1, 1, 0, 1]), Set Display Width(42)),
New Column("V6", Numeric, "Continuous", Format("Best", 12), Set Values([0, 0, 1, 0, 1]))
);
/*
colCount = 10;
dt = new table("example",
add rows(1000),
New Column("ID", Numeric, Ordinal, << Set Each Value(Row()));
);
For(i = 1, i <= colCount, i++,
dt << New Column("V" || char(i), Numeric, Ordinal,
<< Set Each Value(Random Binomial(1, 0.9))
);
);
*/
colNames = dt << Get Column Names("String");
//Drop ID column
colNames = Substr(colNames, 2);
//sorting list https://community.jmp.com/t5/JSL-Cookbook/Sorting-Lists/ta-p/240795
//create ranking based on sums and column idx
sumsOfCols = V Sum(dt[0, colNames]); //order is same as in coLNames
orderCols = Reverse(Rank(sumsOfCols));
newCol = dt << New Column("ORDERED", Character, Nominal);
For Each Row(dt,
//Indices of columns which have 1
idxWithOne = Loc(dt[Row(), colNames]);
//if all values are missing continue to next row
If(N Items(idxWithOne) == 0,
continue();
);
//fill list with empty values
tempList = Repeat({""}, N Items(colNames));
//replace empty with colnames which had 1
tempList[idxWithOne] = colNames[idxWithOne];
//reorder list based on sum ranking
reOrderedList = tempList[orderCols];
//create string of list and remove whitespaces
orderedString = Trim Whitespace(Collapse Whitespace(Concat Items(tempList[orderCols], " ")));
//add value to column
newCol[Row()] = orderedString;
);또한 넥타이에 대한 특정 처리가 없습니다.

대화식으로 이 작업을 수행할 수도 있습니다.
스택 데이터:

수식 추가:
New Column("Orders",
Numeric,
"Continuous",
Format("Best", 12),
Formula(Col Sum(:Data, :Label))
),
New Column("RankForId",
Numeric,
"Continuous",
Format("Best", 12),
Formula(Col Rank(Col Max(:Orders) - :Orders, :ID)),
Set Display Width(70)
),
New Column("ColumnName",
Character,
"Nominal",
Formula(If(:Data == 1, :Label))
)ID 및 RankForId별로 데이터 정렬(둘 다 선택하고 오름차순 정렬):

데이터 전치:


열 메뉴에서 레이블 열 제거 및 행 열 결합:

불필요한 열을 제거하고 필요한 경우 원래 데이터 테이블에 다시 조인합니다.
대화형 솔루션은 스크립팅 버전과 관계 간에 순서가 다를 수 있습니다.