求助高手啊~!!! 感激不尽!) K6 ?% Z2 M0 M9 Y/ j% ?- S' z
' G7 R9 m( L" |; P; h f
如果我需要判断3种货物分别是否需要补货,并且设置其对应的补货量, 而由于模块容量限制, 我希望能用一个Equation来编辑公式从而达到目的, 用如下公式能否实现:1 ~$ l6 d$ u+ `3 ]4 f- ]
***********其中inv1,2,3分别表示3种货品各自的库存量, ss1,2,3分别表示各自的安全库存 ***********
" t% p/ u0 _% a' N4 {$ D***********S1,2,3分别表示各自的最大库存, out1,2,3分别为各自的补货量***********, M, J: u8 S3 \6 c. O
: ^# t- Q, h: {8 T5 D- o! n
: o g7 A2 ]9 @% Y3 s4 C4 v
if (inv1<=ss1 and inv2>ss2 and inv3>ss3)/ E# F3 q/ [ P# a
out1=S1-inv1;
+ _0 x u) }$ o' y# n3 nout2=0;
9 P' {) `$ f- A: cout3=0; /货品1需要补货/6 r# M9 p! P( f1 _2 s; y2 R& @
. G5 S1 M0 F/ G9 L- h" [( ?# ^
else if (inv1>ss1 and inv2<=ss2 and inv3>ss3)
4 }# X$ H1 I7 b/ j9 j6 `out1=0;
# Q# w9 o- e, b! L+ n( E' N: Lout2=S2-inv2;
: F0 f% j1 P+ S' \0 d U1 I8 Tout3=0; /货品2需要补货/
6 G$ s* b. _9 `' x# {7 }& S0 |3 y9 Y% Z
else if (inv1>ss1 and inv2>ss2 and inv3<=ss3)' X. S; b% m: F& ~( l
out1=0;8 [7 K4 |& v/ ?
out2=0;
4 O" \9 E8 w0 m. v' Fout3=S3-inv3; /货品3需要补货/. f* J+ S* R" p: D, B
3 S$ W3 j4 G# P3 Q: }/ `
else if (inv1<=ss1 and inv2<=ss2 and inv3>ss3)
s8 i& _' t. }, [% L) W8 i0 d% t* m/ Uout1=S1-inv1;0 \$ e/ |2 X! Z( S( u2 V
out2=S2-inv2;' x# _1 M- V l9 I# ?3 n/ [
out3=0; /货品1,2需要补货/9 k c- k' D& @+ T1 z- C% ^6 z
7 y( T% W+ l/ Q
else if (inv1<=ss1 and inv2>ss2 and inv3<=ss3)) S$ p1 S' n0 G- V* P# [
out1=S1-inv1;! T; F: R8 w9 x$ D/ w0 W5 @: |" V
out2=0;
[+ q5 m1 d3 N$ z! ]% Zout3=S3-inv3; /货品1,3需要补货/
0 }0 E! a* i. ^& o- K% v1 H. V
$ T& {, ~( D& e7 h" belse if (inv1>ss1 and inv2<=ss2 and inv3<=ss3)
- Z' Z3 ]0 B# a. uout1=0;
& h, ?. E1 ~; p4 d6 j) K5 Eout2=S2-inv2;
; K' R+ r. w$ t* _% @out3=S3-inv3; /货品2,3需要补货/, D8 M9 T! `2 g4 G& q3 F: t
7 l% N; y8 g2 y) v( A- h! Gelse if (inv1<=ss1 and inv2<=ss2 and inv3<=ss3)
& [ D, A6 V' ~0 X$ fout1=S1-inv1;
4 _. g' n. ?" n( J! v$ z! \out2=S2-inv2;0 R; _7 d: i) X1 a v$ w# _1 g2 h
out3=S3-inv3; /货品1,2,3需要补货/* V4 P- s0 b; T7 x
% L( M4 ^& {3 F: A问题1: 我用上述公式写入Equation模块,提示错误,"Found ELSE, expecting: ++ -- <identifier> ABORT BREAK CONTINUE...",
% c: i+ u: z; x- A. ` e9 |但是如果把所有的else if 中的else去掉, 即没有提示错误. 不过我新建了一个简易的模型测试了一下, 上述公式不能达到我想要的效果.
' R V$ ^5 b2 w$ A. z( P* k9 s2 K6 e" G- q `
请问,需要如何编写公式才能达到实时判断, 3种产品分别需要多少补货量呢?$ {9 _! i0 K3 K4 t) ] T
谢谢~!!!!!!! |