关于数据表框中的制表、排序、颜色单元格的 JSL 问题大家好,我的目的是通过制表创建多个表,将每个表中的目标列从大到小排序,通过新窗口将它们放在一起,并以绿色显示第一行数据。下面是我用样本数据大类执行的操作,但出现了一些问题,我不知道为什么:
1.排序窗口保持打开状态,并不真正执行排序
2.列表平台保持开放
3. 将单元格放入新窗口中的数据表框后,不知道如何为其着色
以下是我的 JSL:
Open( "$SAMPLE_DATA/Big Class.jmp" );
Data Table( "Big Class.jmp" ) << Tabulate();
Local( {obj},
obj = Data Table( "Big Class.jmp" ) << Tabulate(
Show Control Panel( 0 ),
Add Table(
Column Table( Analysis Columns( :height ) ),
Row Table( Grouping Columns( :name ) )
)
);
dt1 = obj << Make Into Data Table;
obj << Close Window;
);
dt1 << Sort(
By( :"sum(height)"n ),
Replace Table,
Order( Descending )
);
Data Table( "Big Class.jmp" ) << Tabulate();
Local( {obj},
obj = Data Table( "Big Class.jmp" ) << Tabulate(
Show Control Panel( 0 ),
Add Table(
Column Table( Analysis Columns( :weight ) ),
Row Table( Grouping Columns( :name ) )
)
);
dt2 = obj << Make Into Data Table;
obj << Close Window;
);
dt2 << Sort(
By( :"sum(weight)"n ),
Replace Table,
Order( Descending )
);
nw = new window("summary", H list box(data table box(dt1), data table box(dt2)));
自动化和脚本回复:JSL 数据表框中制表、排序、颜色单元格问题可能是与命名空间相关的问题(您正在使用本地)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
obj = dt << Tabulate(
Show Control Panel(0),
Add Table(Column Table(Analysis Columns(:height)), Row Table(Grouping Columns(:name)))
);
dt1 = obj << Make Into Data Table;
obj << Close Window;
dt1 << Sort(By(:"sum(height)"n), Replace Table, Order(Descending));
obj = dt << Tabulate(
Show Control Panel(0),
Add Table(Column Table(Analysis Columns(:weight)), Row Table(Grouping Columns(:name)))
);
dt2 = obj << Make Into Data Table;
obj << Close Window;
dt2 << Sort(By(:"sum(weight)"n), Replace Table, Order(Descending));
nw = New Window("summary", H List Box(Data Table Box(dt1), Data Table Box(dt2)));
回复:JSL 数据表框中制表、排序、颜色单元格问题多谢!
我尝试过,但仍然遇到排序平台打开的问题,并没有真正采取任何行动。
如果我逐行运行代码,它可以工作,但不知道为什么在运行整个代码时会失败......
回复:JSL 数据表框中制表、排序、颜色单元格问题以下是我如何让您的代码发挥作用的方法:

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
//Data Table( "Big Class.jmp" ) << Tabulate();
//Local( {obj},
obj = Data Table( "Big Class.jmp" ) << Tabulate(
Show Control Panel( 0 ),
Add Table( Column Table( Analysis Columns( :height ) ), Row Table( Grouping Columns( :name ) ) )
);
dt1 = obj << Make Into Data Table;
obj << Close Window;
//);
dt1 << Sort( By( :"sum(height)"n ), Replace Table, Order( Descending ) );
// Color the cells in row 1
Current Data Table( dt1 );
:name << color cells( "green", 1 );
:"Sum(height)"n << color cells( "green", 1 );
//Data Table( "Big Class.jmp" ) << Tabulate();
Local( {obj},
obj = Data Table( "Big Class.jmp" ) << Tabulate(
Show Control Panel( 0 ),
Add Table( Column Table( Analysis Columns( :weight ) ), Row Table( Grouping Columns( :name ) ) )
);
dt2 = obj << Make Into Data Table;
obj << Close Window;
);
dt2 << Sort( By( :"sum(weight)"n ), Replace Table, Order( Descending ) );
// Color the cells in row 1
Current Data Table( dt2 );
:name << color cells( "green", 1 );
:"sum(weight)"n << color cells( "green", 1 );
// The only way I know to copy cell colors in a data table to a display
// window, is to move the data table with the colored cells to a journal
// Then it can be copied into a display object in a display window.
// I repeat the operation twice in the code below
nw = New Window( "summary", hls = H List Box() );
intJr = New Window( "x", <<JOURNAL></JOURNAL>