Merci les gars, je suis novice, veuillez demander comment inclure le symbole de comparaison et la valeur entrée par l'utilisateur dans le calcul JSL, j'utilise eval(parse()), mais cela ne peut pas être réalisé, merci.
names default to here(1);
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
New Window( "合格率报表",
Data Filter Context Box(
H List Box(
dfsb = Current Data Table() << Data Filter( Local ),
Platform(
Current Data Table(),
V List Box(
Outline Box( "请输入所有参数规格限",
Lineup Box( N Col( 3 ), Spacing( 5 ),
Panel Box( "age",
Lineup Box( N Col( 3 ), Spacing( 5 ),
Text Box( "upper " ),
dluf = Combo Box( {"<=", "<"} ),
dlu = Number Edit Box(15),
Text Box( "lower " ),
dlbf = Combo Box( {">=", ">"} ),
dlb = Number Edit Box(-3)
)
),
Panel Box( "height",
Lineup Box( N Col( 3 ), Spacing( 5 ),
Text Box( "upper " ),
dauf = Combo Box( {"<=", "<"} ),
dau = Number Edit Box(),
Text Box( "lower " ),
dabf = Combo Box( {">=", ">"} ),
dab = Number Edit Box()
)
),
Panel Box( "weight",
Lineup Box( N Col( 3 ), Spacing( 5 ),
Text Box( "upper " ),
dbuf = Combo Box( {"<=", "<"} ),
dbu = Number Edit Box(),
Text Box( "lower " ),
dbbf = Combo Box( {">=", ">"} ),
dbb = Number Edit Box()
)
),
Button Box( "确定",
//获取规格限数字
ageu = dlu << get;
agel = dlb << get;
heiu = dau << get;
heil = dab << get;
weiu = dbu << get;
weil = dbb << get;
//获取规格限数字是否包含
aguf = ((dluf << XPath( "//ComboBox" )) << get selected)[1];
aglf = ((dlbf << XPath( "//ComboBox" )) << get selected)[1];
heuf = ((dauf << XPath( "//ComboBox" )) << get selected)[1];
helf = ((dabf << XPath( "//ComboBox" )) << get selected)[1];
weuf = ((dbuf << XPath( "//ComboBox" )) << get selected)[1];
welf = ((dbbf << XPath( "//ComboBox" )) << get selected)[1];
)
)
),
dt << Tabulate(
Set Format(
Mean(
:Name( "age" )(6, "Best"),
:Name( "height" )(6, "Best"),
:Name( "weight")(6, "Best"),
Analysis Columns(
Transform Column( "age rate", eval(parse("if(:age"||aglf|| char(agel)|| ":age"||aguf||char(ageu)||",1,0)")) ,
Format( 9, 2, "Percent" )
)),
Analysis Columns(
Transform Column( "height rate", Formula( eval(parse("if(:height"||helf|| char(heil)|| ":height"||heuf||char(heiu)||",1,0)")) ) ),
//强行修改格式
Format( 9, 2, "Percent" )
),
Analysis Columns( Transform Column( "weight rate", Formula( eval(parse("if(:weight"||welf|| char(weil)|| ":weight"||weuf||char(weiu)||",1,0)")) ) ), Format( 9, 2, "Percent" ) )
),
N( 9, "Best" )
),
Add Table(
Column Table(
//具体固定统计列
Analysis Columns( :Name( "age" ), :Name( "weight" ), :Name( "height" ) ),
Statistics( Mean, Range )
),
//调整样本量列的实际位置
Column Table( Statistics( N ) ),
column table(Analysis Columns(
Transform Column( "rate age", Formula( eval(parse("if(:age"||aguf|| char(agel)|| ":age"||aguf||char(ageu)||",1,0)"))) ) ),Statistics( Mean )
),
Column Table(
Analysis Columns( Transform Column( "height rate", Formula( eval(parse("if(:height"||helf|| char(heil)|| ":height"||heuf||char(heiu)||",1,0)")) ) ) ),
Statistics( Mean )
),
Column Table(
Analysis Columns( Transform Column( "weight rate", Formula( eval(parse("if(:weight"||welf|| char(weil)|| ":weight"||weuf||char(weiu)||",1,0)")) ) ) ),
Statistics( Mean )
),
//临时固定类别列,且可以通过拖拽进行增删
Row Table( Grouping Columns( :sex ) )
)
);
)))))