- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I’m currently working on a FlexSim model where I use a Statistics Collector to track the tonnage transported every time a resource is used.
I’ve successfully collected the data including timestamps, and the table looks like this:
DateTime | Tonnage | Tonnage_Mng
---------------------------------------------------
02/06/2025 04:50:24 | 10000 |
02/06/2025 07:57:35 | 10000 |
02/06/2025 08:16:57 | 10000 |
... | ... | ...
07/07/2025 10:18:53 | 0 | 36.40
07/07/2025 10:38:23 | 0 | 54.60
...
Now, I want to generate a cumulative plot of the tonnage over time — something like a running total that increases as new data points are added :
DateTime | Tonnage | Tonnage_Mng
---------------------------------------------------
02/06/2025 04:50:24 | 10000 |
02/06/2025 07:57:35 | 20000 |
02/06/2025 08:16:57 | 30000 |
... | ... | ...
07/07/2025 10:18:53 | 0 | 36.40
07/07/2025 10:38:23 | 0 | 91
...
I tried using the "increment data" option, but it only works when staying on the same row, which doesn't fit my use case where each data point is on a new row.
I also attempted to use custom code, but I couldn’t figure out how to access the value from the previous row (n-1) to calculate the cumulative total.
Has anyone faced a similar challenge or knows how to solve this ?
Thank you in advance
Solved! Go to Solution.