question

Patcharin B2 avatar image
0 Likes"
Patcharin B2 asked Patcharin B2 commented

Convert Time Unit in Statistic Collector

Hello. I want to convert stay time in from second to minute.

1671467930532.png

From picture I crate "Entry Lift Waiting" Table Chart by ZONE in process flow then pin Stay Time of Zone to Dashboard and install Statistic Collector for convert second to minute by /60 in avg. and max. column.

So, If I use /60 the time will be normal number. How can I convert time in normal number to time in time number. Such as from 90 second = 1.50 minute convert to 90 second = 1.30 minute.

Thank You.

FlexSim 22.2.2
timestaytimestatisctis collectorconvert time
1671467930532.png (42.2 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.

Jason Lightfoot avatar image
2 Likes"
Jason Lightfoot answered Patcharin B2 commented

Install the stats collector and the for each of the time fields/columns wrap the expression for the time value (without the divisor) like this:

DateTime(<expression>).toString("%H:%M:%S")

so in the attached example the original expression was:

getstat(data.rowValue, "Staytime", STAT_AVERAGE, instance) / collector.TimeDivisor

while the new column is

DateTime(getstat(data.rowValue, "Staytime", STAT_AVERAGE, instance) ).toString("%H:%M:%S")

StatsCollectorTimeFormatting.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.

Patcharin B2 avatar image Patcharin B2 commented ·
OK I can do this. Thank You Somuch.
0 Likes 0 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Patcharin B2 commented

Please do it in the display Unit of each Chart in Dashboard. unit-conversion.jpg


unit-conversion.jpg (29.2 KiB)
· 5
5 |100000

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

Patcharin B2 avatar image Patcharin B2 commented ·

1671470395723.png

This Table Chart is come from ZONE in process flow. It are not Time Unit field. So I has create Statistic Collector by install from advance of this chart.

1671470705991.png

And although stay time chart will has Time Unit field, when select unit to minute it will be normal number (0-99).

How can I convert time unit to time number (0-59). Such as 1.50 minute convert to 1.30 minute.

0 Likes 0 ·
1671470395723.png (29.3 KiB)
1671470705991.png (80.9 KiB)
Jeanette F avatar image Jeanette F ♦♦ Patcharin B2 commented ·

Hello @Patcharin B2,

You can add a label to the statistics collector that is for the conversion.

1671492834709.png

Then for each of the statistics apply the conversion. So I wanted to convert from the model units of seconds to minutes so I used 60 for the conversion and then divided by the conversion.

1671492879935.png


0 Likes 0 ·
1671492834709.png (12.8 KiB)
1671492879935.png (26.0 KiB)
Patcharin B2 avatar image Patcharin B2 Jeanette F ♦♦ commented ·


1671498866136.png

1671498957173.png

Thank You for reply. This way to solve this is at like before, that I use divided by 60 directly at Value. Yes, a time are convert from second to minute but it will be in Red Circle it be 0.93 minute. From this case in this picture. Example in this case how can I convert from 0.93 to 1.63 minute.

0 Likes 0 ·
1671498866136.png (41.9 KiB)
1671498957173.png (17.7 KiB)
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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