Page 1 of 1

Subscripts and flows

Posted: Thu Nov 15, 2018 1:12 pm
by Phill
Hello,

I'm trying to do something I thought would be very simple and I'm ashamed to say I'm going around in circles! In the attached simple model, I have a stock representing a warehouse that receives imported goods. Those goods are then transferred to nearby warehouses for shipment to specific geographic regions and you can see flows from the main warehouse to two others, one for shipments to Scotland and one for shipments to Wales. The real model needs 18 different shipment areas.

This model structure works, but I want to avoid 18 different flows in the sketch by subscripting from the point where goods flow out of 'Warehouse1'. My problem is that the stock in Warehouse1 isn't broken down into regions, the choice being made at that point, so that stock can't be subscripted. How can I introduce subscripted elements at this stage and avoid the 'Subscript appears on the right, but not on the left' error?

Re: Subscripts and flows

Posted: Thu Nov 15, 2018 2:49 pm
by Administrator
Try this,
warehouseSS.mdl
(3.76 KiB) Downloaded 245 times

Re: Subscripts and flows

Posted: Thu Nov 15, 2018 3:24 pm
by Phill
Thank you very much indeed. I see the part I was missing is to sum the subscripted outflow in the unsubscripted warehouse stock,

Incoming Stock
- sum ( Stockflow[Destinations!] )

Originally, I had that as equivalent to 'Incoming Stock - Stockflow[Destinations]' and that gave rise to the 'subscript on right but not on left' error.

Thanks again,
Phillip