question

ana.pc2 avatar image
0 Likes"
ana.pc2 asked ana.pc2 commented

Statistics Collector on Event Create/Update

Hello!

I want to create a Statistics Collector to keep track of the date of the entry and exit for a item on a processor, but the problem is that it is also possible that the item comes back to the same processor again for another process.

Right now it is updating the old record when the item reenters (because I need to update the exit date for the same name when the item enters. So it will do the same if the item comes back, it will update, not create a new row, only if it has a new item name), so I lose the previous record, and have an updated one...

Does anyone have an idea on how to do keep both records with same item name: update only for exit (EndTime) and create a new row only when the item enters (StartTime)? Could it be done with a custom code at the Row value on the statistics collector Events properties?

My Row Value on the Events properties is the Item Name (return data.item.Name), so it can find it at the Item Column and update the item for the EndTime Column.

Any help is appreciated, thanks for your time!

FlexSim 20.1.1
statistics collectorflexsim 20.1.1
4.png (31.1 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Mischa Spelt avatar image
1 Like"
Mischa Spelt answered ana.pc2 commented

Below where you set the Row Value, there is a checkbox "Finish involved rows after this event". If you check that for your Processor Exit event, the Statistics Collector will create a new row when the row value is ever seen again after that event.

See StatsCollectorFinishRow.fsm


· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

ana.pc2 avatar image ana.pc2 commented ·

Oh, Thanks!! It was easier than I thought :D

0 Likes 0 ·