通过日志中的循环从大纲框中提取数据大家好,
我正在尝试编写一个脚本来为我打印数据。我有一本日记,我想在其中打印每个大纲框的数据(请参阅日记数据.jrn)。
我知道我离我想要的数据表还差很多,但我遇到了第一个障碍,那就是它只打印 1 个轮廓框,而不是全部。请参阅下面的脚本:
// JMP version 16<BR />sd = currentdatatable();<BR />rpt = Current Journal();
// Get the number of outline boxes
numOutlineBoxes = nitems(rpt);
int = rep = sumfit = sumfitLL = sumfitUL = {};
sum = 0;
// Loop through each outline box
for (i = 1, i <= numOutlineBoxes, i++,
outlineBox = rpt[i];
sumfit = outlineBox[Outline Box( numOutlineBoxes )][Number Col Box( 1 )] << Get as Matrix;
sumfitLL = outlineBox[Outline Box( numOutlineBoxes )][Number Col Box( 3 )] << Get as Matrix;
sumfitUL = outlineBox[Outline Box( numOutlineBoxes )][Number Col Box( 4 )] << Get as Matrix;
sumfit_rep = Round( sumfit[2] , 3 );
sumfit_int = Round( sumfit[3] , 3 );
lowerCL_rep = Round( sumfitLL[2] , 3 );
upperCL_rep = Round( sumfitUL[2] , 3 );
lowerCL_int = Round( sumfitLL[3] , 3 );
upperCL_int = Round( sumfitUL[3] , 3 );
Insert Into( rep, Char( sumfit_rep ) || " [" || Char( lowerCL_rep ) || " ; " || Char( upperCL_rep ) || "]" );
Insert Into( int, Char ( sumfit_int ) || " [" || Char( lowerCL_int ) || " ; " || Char( upperCL_int ) || "]" );
// Get By Group column
//whereCol = Word( 2, ((rep << parent)[Text Box( 1 )]) << get text, ":=)" );
term = outlineBox[Outline Box( numOutlineBoxes )][String Col Box( 1 )] << Get();
sum = sum + 1
);
// Create the table
dlg = New Window( "Custom Report",
Outline Box( "Selected Values",
Lineup Box( N Col( 2 ), Text Box( "Factor of Interest: " ), Text Box( term[1] ) ),
Spacer Box( size( 0, 10 ) ),
tb = Table Box(
String Col Box( "Paramenter", testvalue ),
//String Col Box( whereCol, repeat(ByGroups, sum) ),
String Col Box( "Repeatability, " || term[1], rep ),
String Col Box( "Intermediate precision, " || term[2], int ),
)
)
);
tb << Set Shade Headings( 0 ); // Turn off shaded table headings.
tb << Set Column Borders( 1 ); // Turn off table column borders.
tb << Set row Borders( 1 );
tb << border( 1 );打印结果如下:

在最后阶段,我希望品脱看起来如下:

总结一下,我有以下步骤需要修复:
1. 使循环工作,以便考虑所有轮廓框
2. 获取它包括参数和批次
3. 用实验室AA/BB分别打印重复性和中间体
我希望你能帮助我。
此致,
朱莉
自动化和脚本基础数据分析与建模数据访问回复:通过日志中的循环从大纲框中提取数据是否有特定原因导致使用日记帐而不是在将报告制作成日记帐之前对其进行访问?您是否还尝试过使用“制作组合数据表”从可以获得的表格中构建报告?


回复:通过日志中的循环从大纲框中提取数据然后,如果你有足够的耐心(我对 Tabulate 没有耐心...),你也许能够使用 tabulate 创建相当不错的报告



这需要 JMP17 或 JMP18(打包)

回复:通过日志中的循环从大纲框中提取数据鉴于您的日记被引用为
rpt = Current Journal();
您正在使用
// Get the number of outline boxes
numOutlineBoxes = nitems(rpt);
要获取 OutlineBox 的数量,它将始终返回 1。您应该使用 Xpath() 返回所有 OutlineBox 的列表。
numOutlineBoxes = nitems(rpt << xpath( "//OutlineBox" )) ;
但是它会找到 60 个轮廓框。因此,为了缩小范围,你可以使用以下命令获取主要标题的列表
majorrptList= rpt << xpath( "//OutlineBox[contains(text(),'Variability Gauge')]" )
这将为您提供指向每个 By groups 输出的指针
回复:通过日志中的循环从大纲框中提取数据嗨,Jthi,
谢谢你的回复。之所以使用日志而不是报告,是因为我无法保存仍包含标准差轮廓框的报告。因此,我不得不将其保存到日志中。
我将尝试研究这个选项,将其制成组合表。
此致,
朱莉
回复:通过日志中的循环从大纲框中提取数据嗨吉姆,
感谢您的回复。我尝试过这个,其中我将 numOutlineBoxes 更改为:
majorrptList = rpt << xpath( "//OutlineBox[contains(text(),'Standard Deviations')]" );
The script saves information to sumfit_rep and sumfit_int, but it does not save to lowerCL_rep , upperCL_rep , lowerCL_int or upperCL_int during the part below:
sumfit = outlineBox[Outline Box( majorrptList )][Number Col Box( 1 )] << Get as Matrix;
sumfitLL = outlineBox[Outline Box( majorrptList )][Number Col Box( 3 )] << Get as Matrix;
sumfitUL = outlineBox[Outline Box( majorrptList )][Number Col Box( 4 )] << Get as Matrix;
sumfit_rep = Round( sumfit[2] , 3 );
sumfit_int = Round( sumfit[3] , 3 );
lowerCL_rep = Round( sumfitLL[2] , 3 );
upperCL_rep = Round( sumfitUL[2] , 3 );
lowerCL_int = Round( sumfitLL[3] , 3 );
upperCL_int = Round( sumfitUL[3] , 3 );
Insert Into( rep, Char( sumfit_rep ) || " [" || Char( lowerCL_rep ) || " ; " || Char( upperCL_rep ) || "]" );
Insert Into( int, Char ( sumfit_int ) || " [" || Char( lowerCL_int ) || " ; " || Char( upperCL_int ) || "]" );
由于我不确定如何从这里获取我想要的包含样本/批次和参数信息的表格,我尝试制作一个组合表,然后从那里提取它,但它做了一些疯狂的事情,我非常困惑。我附上了组合表(int rep 测试脚本的组合数据表)和脚本(带有组合表的 int rep 测试脚本)。我希望你能看一看,看看你是否能找到混乱的原因:)