question

Mohamed Eldakroury avatar image
0 Likes"
Mohamed Eldakroury asked Mohamed Eldakroury commented

Zone data into Statistics Collector

Hello,

I am building a statistics collector to pull data from zones. I need to get the total value of a subset calculation. I'm using a timer event, so every 7 days I'll pull all zones data.


The stat collector gives the option to get data from zones and I can specify that I need a calculation request input. However, I can't find a way to tell it what calculation I need to pull data for, and I end up with a long number that doesn't really represents what I want. Is that what the "requirement" filed is for? or do I need to edit the code to do this?



1711553955119.png

1711554030684.png


1711554288458.png


FlexSim 23.2.0
statistics collectorzonezone statistics
1711553955119.png (30.8 KiB)
1711554030684.png (23.1 KiB)
1711554288458.png (29.7 KiB)
· 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.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Mohamed Eldakroury commented

If there is a working default chart, then you can install its components to inspect how they work and even possibly start from there to adjust the Statistics Collector to your needs.

1711561422505.png

The correct expression in this case is the following.

  1. getstat(data.rowValue, "CalculationTotal", STAT_CURRENT, instance, "Weight", "TotalWeight")

The "requirement" is two separate values in this case, so the GUI is actually inadequate and doesn't allow you to input both. Only option I see is to edit the code manually.

In the attached model I also modified your collector further to get the sum of the calculation over all four 4 zones by using an array with all zones as the row value and running a for-loop over all of them when determining the column value.

zone-statcollector_1.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.