求助高手啊~!!! 感激不尽!) [( \5 W _% d- s" H. k
Y4 c: Y. e0 d6 a1 ` G
如果我需要判断3种货物分别是否需要补货,并且设置其对应的补货量, 而由于模块容量限制, 我希望能用一个Equation来编辑公式从而达到目的, 用如下公式能否实现:
3 m8 K' {; T% k" @/ v***********其中inv1,2,3分别表示3种货品各自的库存量, ss1,2,3分别表示各自的安全库存 ***********" {& L9 C$ {: s$ b3 Q
***********S1,2,3分别表示各自的最大库存, out1,2,3分别为各自的补货量***********
: s0 P0 i; g1 c; w! j; L1 u& d1 }2 {" ~" O; J& v
. P% q* N; S$ l& O$ B1 Y* Vif (inv1<=ss1 and inv2>ss2 and inv3>ss3)
+ l6 I" M% f6 P3 U5 kout1=S1-inv1; D/ ~4 j) e; t# w' ^6 T$ V
out2=0;3 q- c$ ? [/ U3 @7 u. s( ~6 |
out3=0; /货品1需要补货/
1 i6 r2 l6 h: n1 {; V2 r H) R+ }7 f; V n" E: ?( {) ~
else if (inv1>ss1 and inv2<=ss2 and inv3>ss3), H. p7 d9 s4 N# I( Z
out1=0;
7 f: j/ Q g, V+ m2 i+ b8 lout2=S2-inv2;
3 }$ z/ w4 a& Y2 i' L, Wout3=0; /货品2需要补货/' b8 T' ]& [, W& P+ }/ Z
* i# r3 [3 e. m3 L6 G( Uelse if (inv1>ss1 and inv2>ss2 and inv3<=ss3)7 O y, r- V0 M
out1=0;
; k7 Z: P( x" P6 Hout2=0;
; y' b% y% |4 L: G4 x% |$ Dout3=S3-inv3; /货品3需要补货/9 P, ], v2 h# o! G% C1 b& u
" s% g$ Y C f: w: melse if (inv1<=ss1 and inv2<=ss2 and inv3>ss3)
/ N/ i# n8 i1 s7 E- x" O9 W" Tout1=S1-inv1;
& L0 x8 \: B3 V- V" L4 _) fout2=S2-inv2;9 {% t$ E: z0 f/ M# t$ f
out3=0; /货品1,2需要补货/* C% v4 S7 d1 w
' n- G- n- t1 }) S# _else if (inv1<=ss1 and inv2>ss2 and inv3<=ss3)3 [7 }/ t+ B! y0 c) a
out1=S1-inv1;; D7 X' p% W2 w3 R
out2=0;
) Y" H9 N& |; F Sout3=S3-inv3; /货品1,3需要补货/' h7 o4 f5 k! k
* @5 O8 R9 o5 H: _) \- w s( J! Welse if (inv1>ss1 and inv2<=ss2 and inv3<=ss3)" E7 Z* d& b! d
out1=0;
7 r) k& ^! A5 G- c! [! u# ]6 vout2=S2-inv2;" m, v* Q0 |# o- m
out3=S3-inv3; /货品2,3需要补货/1 g2 N" w8 e; S5 m
: W; ]8 l; [1 c/ q6 x3 B* L5 [& R( Belse if (inv1<=ss1 and inv2<=ss2 and inv3<=ss3)3 O7 |" ]- c3 J3 h$ y
out1=S1-inv1;
2 B$ y# h$ F+ c" {out2=S2-inv2;3 A; {, Y; t! X5 W6 D+ u
out3=S3-inv3; /货品1,2,3需要补货/
$ i; L4 ?9 t" Y- r. |1 A
R7 J! L e( n* }" U问题1: 我用上述公式写入Equation模块,提示错误,"Found ELSE, expecting: ++ -- <identifier> ABORT BREAK CONTINUE...",
% W$ c1 Z8 Q: b但是如果把所有的else if 中的else去掉, 即没有提示错误. 不过我新建了一个简易的模型测试了一下, 上述公式不能达到我想要的效果.
/ g$ U: u8 O) A: z9 y. g
8 ~' n" a6 H3 D+ e& c. ?请问,需要如何编写公式才能达到实时判断, 3种产品分别需要多少补货量呢?
8 |& F' K( W0 v: J谢谢~!!!!!!! |