能否将这两步计算修改为一步完成?谢谢专家!
dt=Open("$SAMPLE_DATA/Big Class.jmp");
ca="A";If(Is Missing(Try(Column(ca)<
<GET name="">
=lag(height,1),weight) );Current Data Table()<
<RUN formulas="">
9,round(sum(A[Index(Row()-9,Row())])/sum(B[Index(Row()-9,Row())]),2) ));Current Data Table()<
<RUN formulas="">
9,sum(weight[Index(Row()-9,Row())]&height[Index(Row()-9,Row())]>=height[Index(Row()-10,Row()-1)])/sum(weight[Index(Row()-9,Row())]&height[Index(Row()-9,Row())]
<HEIGHT></HEIGHT>
</RUN>
</RUN>
</GET>
<P><SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2025-09-21_17-40-41.png" style="width: 954px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-09-21_17-40-41.png" style="width: 954px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-09-21_17-40-41.png" style="width: 954px;"><SPAN class="lia-inline-image-display-wrapper" image-alt="2025-09-21_17-40-41.png" style="width: 954px;"><span class="lia-inline-image-display-wrapper" image-alt="2025-09-21_17-40-41.png" style="width: 954px;"><img src="https://us.v-cdn.net/6038925/uploads/images/83044iC4F2464B26238C93/2025-09-21_17-40-41.png" role="button" title="2025-09-21_17-40-41.png" alt="2025-09-21_17-40-41.png" /></span></SPAN></SPAN></SPAN></SPAN></P>
<LINGO-LABS id="lingo-labs-902375" slang="en-US" mode="CREATE">
<LINGO-LABEL>自动化和脚本</LINGO-LABEL>
</LINGO-LABS>
回复:这两步计算可以修改为一步完成吗?(假设您的目标是速度,或者更容易阅读代码......)
列公式并不是什么魔法。它们并不比 JSL 快。它们就是 JSL。
好吧,它们可能有点神奇;JMP 的列求值引擎确实会找出哪些列依赖于其他列,并优先计算不依赖其他列的公式。但这种情况在这里从未发生过,因为公式被删除了。
由于您要创建/运行/删除公式来填充列,并且要重复四次,因此您可能需要尝试使用包含四个内部语句的单个 JSL 循环。请务必使用 < <
回复:这两步计算可以修改为一步完成吗?所有砝码均不为空。
weight[Index(Row()-9,Row())]&height[Index(Row()-9,Row())]>=height[Index(Row()-10,Row()-1)]
can be reduced to
height[Index(Row()-9,Row())]>=height[Index(Row()-10,Row()-1)]
or maybe: you wanted to calculate something else?
selection of A & B.
comparison of C&D


让我们挑战一下:
一个)
weight[11] = 500;
b)
current data table()<< add rows(10);
height[41::50] = 70;
weight[41::50] = 1;
回复:这两步计算可以修改为一步完成吗?我需要这种由几个公式组成的表格,并且不希望其中有任何循环。
谢谢专家!
aaa="";
current data table(dt);Eval(Parse("Column(dt,\!"ABC\!")<
<FORMULA>
0));
</FORMULA>