Re: 如何根据用户输入的值自动的改变制表平台里的合格率?몇 가지 접근 방식이 있습니다. 다음은 eval insert 함수를 사용한 예이다.
이것 페이지는 표현을 이해하는 데에도 도움이 됩니다.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
create tabulate = Expr(
Parse(
Eval Insert(
"\[
tabulate box = dt << Tabulate(
Set Format(
Mean(
:Name( "age" )(6, "Best"),
:Name( "height" )(6, "Best"),
:Name( "weight" )(6, "Best"),
Analysis Columns(
Transform Column(
"age rate",
Formula ( if(:age ^aglf^ ^agel^ & :age ^aguf^ ^ageu^ ,1,0) ),
Format( 9, 2, "Percent" )
)
),
Analysis Columns(
Transform Column(
"height rate",
Formula( if(:height ^helf^ ^heil^ & :height ^heuf^ ^heiu^ ,1,0) )
),
//强行修改格式
Format( 9, 2, "Percent" )
),
Analysis Columns(
Transform Column(
"weight rate",
Formula( if(:weight ^welf^ ^weil^ & :weight ^weuf^ ^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( if(:age ^aguf^ ^agel^ & :age ^aguf^ ^ageu^ ,1,0) )
)
),
Statistics( Mean )
),
Column Table(
Analysis Columns(
Transform Column(
"height rate",
Formula( if(:height ^helf^ ^heil^ & :height ^heuf^ ^heiu^ ,1,0) )
)
),
Statistics( Mean )
),
Column Table(
Analysis Columns(
Transform Column(
"weight rate",
Formula( if(:weight ^welf^ ^weil^ & :weight ^weuf^ ^weiu^ ,1,0) )
)
),
Statistics( Mean )
),
//临时固定类别列,且可以通过拖拽进行增删
Row Table( Grouping Columns( :sex ) )
)
)
]\"
)
)
);
nw = 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( 15 ),
Text Box( "lower " ),
dabf = Combo Box( {">=", ">"} ),
dab = Number Edit Box( 1 )
)
),
Panel Box( "weight",
Lineup Box( N Col( 3 ), Spacing( 5 ),
Text Box( "upper " ),
dbuf = Combo Box( {"<=", "<"} ),
dbu = Number Edit Box( 15 ),
Text Box( "lower " ),
dbbf = Combo Box( {">=", ">"} ),
dbb = Number Edit Box( 1 )
)
),
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];
Try( tabulate box << delete );
tabulate << append( Eval( create tabulate ) );
)
)
),
//
tabulate = V List Box();
//
)
)
)
)
);Re: 사용자가 입력한 값에 따라 집계 플랫폼에서 자격 비율을 자동으로 변경하는 방법은 무엇입니까?정말 감사합니다. 물어봐도 될까요? "||"를 "&"로 바꿔야 하는 이유는 무엇입니까?
Re: 如何根据用户输入的值自动的改变制表平台里的合格率?귀하의 원래 공식은 "If(:나이 >= 8:나이 < 20, 1, 0);"와 같은 것 같습니다.
수식에 and 연산자가 필요하다고 생각했습니다. "만약(:나이 >= 8 & :나이 < 20, 1, 0);".
평가 삽입 기능을 사용하는 경우 "||"를 추가할 필요가 없습니다. 이 예에서.
aglf = ">=";
agel = 8;
aguf = "<";
ageu = 20;
example1 = eval insert("if(:age ^aglf^ ^agel^ & :age ^aguf^ ^ageu^ ,1,0)");
Show( example1 );사용자가 입력한 값에 따라 집계 플랫폼에서 통과율을 자동으로 변경하는 방법은 무엇입니까?고마워요, 저는 초보자입니다. 사용자가 JSL 계산에 비교 기호와 값을 입력하는 방법을 물어보십시오. eval(parse())를 사용하지만 실현할 수 없습니다. 감사합니다.
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 ) )
)
);
)))))고급 통계 모델링자동화 및 스크립팅맥 OS