Page 1 of 1
separate quants by attribute in a queue
Posted: Sun May 07, 2006 5:31 am
by addor
I have a queue with a random distributed attribute. There come 5 quants with attributes 4, 1, 7, 2, 9. I would like to separate those quants with low attribute (e.g. < 4) from those with high attribute, that is quants no. 2 and no. 4 flows in another stock than quants no. 1, 3 and 5 .
Is this possible?
Posted: Sun May 07, 2006 11:48 pm
by bob@vensim.com
The attributes going into a QUEUE FIFO are all identical at a time. If you have 5 items, each with a different attribute entering you will need to average these. For example assuming the attributes at a time are subscripted you would use
quantity to high quality = SUM(IF THEN ELSE(quality[item!] >= 4,
quantity[item!],0))
avg quality to high quality = ZIDZ(SUM(IF THEN ELSE(quality[item!] >- 4, quality[item!],0)),quantity to high quality)
with similar logic for low quality.
I hope that is helpful. If I did not understand the question let me know.
Posted: Mon May 08, 2006 7:59 am
by addor
You got it correctly. Thanks for the suggestion, it's great!
Peter