선택한 데이터 테이블의 열 이름을 동적으로 나열하는 방법은 무엇입니까?안녕,
두 번째 개요 상자가 왼쪽 위 모서리 목록 상자에서 선택한 데이터 테이블의 열 이름을 동적으로 나열할 수 있는 Tables-Join과 같은 창을 만들려고 합니다.
고급 감사합니다.
스크립팅윈도우Re: 선택한 데이터 테이블의 열 이름을 동적으로 나열하는 방법은 무엇입니까?Names Default To Here(1);
//Open two data tables
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = Open("$SAMPLE_DATA/Consumer Preferences.jmp");
//Make sure the one not used in filter col selector is current data table
Current Data Table(dt2);
wait(0);
//Create filter col selector with non current data table
New Window("Filter Col Selector Example",
fontobj = lb = Filter Col Selector(Data table(dt)) //replace "big class" with dt work.
);데이터 테이블("큰 클래스")을 데이터 테이블(dt)로 바꾸면 작동합니다.
Re: 선택한 데이터 테이블의 열 이름을 동적으로 나열하는 방법은 무엇입니까?Filter Col Selector를 사용할 때 주의해야 할 두 가지 사항이 있습니다.
- Filter Col Selector가 항상 현재 데이터 테이블()을 사용하는 것처럼 보이며 사용하려는 데이터 테이블에 대한 직접 참조를 제공할 수 없습니다. 스크립팅 인덱스를 기반으로 Datatable(name)을 인수로 받아들여야 하므로 버그일 가능성이 높습니다(적어도 JMP16.1에서는).
- Filter Col Box의 빨간색 삼각형은 삭제해야 하는 다른 DisplayBox입니다.
참조 항목을 해결하려면 사용자 선택에 따라 현재 데이터 테이블()을 변경하고 빨간색 삼각형도 삭제하려면 V 목록 상자 주위에 필터 열 상자를 래핑하고 삭제할 수 있습니다.
Names Default To Here(1);
//get a list of window names
windows = Get Data Table List();
/*remove ones that are not data tables--need to start at back of list, because its length will change as we delete items
For( i = N Items( windows ), i > 0, i--,
If( (Window( windows[i] ) << Window Class Name) != "DataTable",
Remove From( windows, i )
)
);
*/
//make a dialog window
nw = New Window("Sample",
vlb1 = V List Box(
lb1 = List Box(
windows, //populate the listbox with data table names
//here is the script that runs each time someone clicks in the top box
//delete the current column list box, if it exists
Try(vlb2 << delete);
//append a new v list box which includes filter col selector
Current Data Table(Data Table((lb1 << get selected)[1]));
vlb1 << append(vlb2 = V List Box(Filter Col Selector()));
)
)
);또한 다음은 Filter Col Selector의 문제를 복제하는 간단한 스크립트입니다.
Names Default To Here(1);
//Open two data tables
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt2 = Open("$SAMPLE_DATA/Consumer Preferences.jmp");
//Make sure the one not used in filter col selector is current data table
Current Data Table(dt2);
wait(0);
//Create filter col selector with non current data table
New Window("Filter Col Selector Example",
fontobj = lb = Filter Col Selector(Data table("Big Class"))
);Re: 선택한 데이터 테이블의 열 이름을 동적으로 나열하는 방법은 무엇입니까?당신의 답변에 감사드립니다. 'col list box'를 'filter col selector'로 바꾸면 예상대로 작동하지 않고 테이블을 선택할 때마다 빨간색 삼각형이 남고 그에 따라 열 목록이 업데이트되지 않습니다.
'filter col selector'를 사용하여 어떻게 작동합니까?
Names Default To Here( 1 );
//get a list of window names
windows = Get Data Table List();
/*remove ones that are not data tables--need to start at back of list, because its length will change as we delete items
For( i = N Items( windows ), i > 0, i--,
If( (Window( windows[i] ) << Window Class Name) != "DataTable",
Remove From( windows, i )
)
);
*/
//make a dialog window
nw = New Window( "Sample",
vlb1 = V List Box(
lb1 = List Box(
windows, //populate the listbox with data table names
//here is the script that runs each time someone clicks in the top box
//delete the current column list box, if it exists
Try( lb2 << delete );
//append a new col list box, with all columns of the data table selected in the listbox
vlb1 << append( lb2 = Filter Col Selector( Data Table( (lb1 << get selected)[1] ), all ) );
)
)
);

Re: 선택한 데이터 테이블의 열 이름을 동적으로 나열하는 방법은 무엇입니까?여보세요,
이를 위해 다음과 같은 코드를 사용할 수 있습니다. 몇 개의 데이터 테이블이 열려 있을 때 이 코드를 실행해 보십시오.
건배,
브래디
Names Default To Here( 1 );
//get a list of window names
windows = Window() << get window title;
//remove ones that are not data tables--need to start at back of list, because its length will change as we delete items
For( i = N Items( windows ), i > 0, i--,
If( (Window( windows[i] ) << Window Class Name) != "DataTable",
Remove From( windows, i )
)
);
//make a dialog window
nw = New Window( "Sample",
vlb1 = V List Box(
lb1 = List Box(
windows, //populate the listbox with data table names
//here is the script that runs each time someone clicks in the top box
//delete the current column list box, if it exists
Try( lb2 << delete );
//append a new col list box, with all columns of the data table selected in the listbox
vlb1 << append( lb2 = Col List Box( Data Table( (lb1 << get selected)[1] ), all ) );
)
)
);

