question

Clinton N avatar image
0 Likes"
Clinton N asked Clinton N commented

How to find average value of an item label

Hi,

I have a model in which after completing processing at a processor there is a 24% chance that the object will come back into the system. I want to find the average value for the number of times an object would be processed.

I created an item label named TimesProcessed at the source and gave it a value 0. On exiting the processor, the value gets incremented by one.

what im struggling with is how to display TimesProcessed average value on a dashboard.

Clinton

dashboardsstatistics
· 3
5 |100000

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

Jeff Nordgren avatar image Jeff Nordgren commented ·
@Clinton N

Can you send in your model or a sample model so that we can see exactly what is happening in the model? It would be helpful to see what you are trying to do in the actual model.

Thanks.

0 Likes 0 ·
Clinton N avatar image Clinton N commented ·

Hi,

I have attached the problem.

problem.fsm

thanks

0 Likes 0 ·
problem.fsm (23.3 KiB)
Clinton N avatar image Clinton N Clinton N commented ·

just incase this is a 2019 version file

0 Likes 0 ·
jing.c avatar image
0 Likes"
jing.c answered Clinton N commented

hi, @Clinton N

If I was you, I will use legacy dashboard charts. Before that I will add the all value of item label to sink's label "total", and it divide by the input of sink is the average value of "TimesProcessed".

You can find the custom charts statistics in the attached model average-label-processtimev19.fsm

P.S. You need to check "show legacy charts" to find legacy charts in dashboard-libary

legacy-charts.png


· 3
5 |100000

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

Clinton N avatar image Clinton N commented ·

Thank you very much it solves my problem. But just wanted to know is there any way to collect the data using statistics collector

0 Likes 0 ·
jing.c avatar image jing.c Clinton N commented ·

Glad to see your problem solved.

I am not quite familiar with Statistics Collector, you can try to ask @jordan.johnson help.

0 Likes 0 ·
Clinton N avatar image Clinton N jing.c commented ·

@jing.chen

I was able to use Statistics Collector and get the same result. It uses a part of your solution like to increment total at sink. In the stats collector i divided it by the input at sink.

Im attaching the solved problem. Hope you are able to understand it.

times-processed-solved.fsm

Thanks a lot guys.

1 Like 1 ·
Joerg Vogel avatar image
3 Likes"
Joerg Vogel answered Jordan Johnson commented

The statistic collector and a calculated table will accomplish your request:

Statistic Collector: OnEntry Event of the sink let you get the value of a label of the item each time a row is added to the result table.

Calculated Table can query the average of the table column of the Statistic Collector.

SELECT AVG(StayTimeProcessor)  AS AvgStayTime FROM [cumulated staytime at processor]

cumulated-processtime-of-multiprocessed-item.fsm

Since you let process the items randomly multiple times at the processor, I increment the label "ProcessedTimes" each time on exit by the staytime of the item on the processor. The color of items depends on the item Type label which I increment on exit by 1 at the processor, too.


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

Jordan Johnson avatar image Jordan Johnson ♦♦ commented ·

This is the solution I recommend, if you are looking to use the stats collector.

2 Likes 2 ·

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.