question

Maryam H2 avatar image
0 Likes"
Maryam H2 asked Maryam H2 commented

Frequency of the Chart Data

Hi there,

How we can get the frequency of chart data. For example, If we create a calculated table to calculate the maximum "Wait Time for a Location" and the maximum wait time reports XX minutes, how we can get the frequency of that max value? I see in the "Person Statistic Tables> Person Wait Times" the value of wait times aggregated for all locations.


Thanks!

FlexSim 22.0.0
statistics collectorwait timesmax wait time
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 Maryam H2 commented

You can do this in a single query.

SELECT [colName], COUNT([colName]) FROM tableName GROUP BY [colName] ORDER BY [colName] DESC

will return a table with the values from the specified column in descending order next to the number of how often that value appears in the table. If you only want to see the highest value (which would always be in the first row) you can add "LIMIT 1" to the end of the query.

· 12
5 |100000

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

Maryam H2 avatar image Maryam H2 commented ·

@Felix Möhlmann Thanks for the answer!

I was wondering which query you meant. Do you mean the "Query" window under the "Calculation" tab in the relative calculated table? If so, do I need to add the query you mentioned in addition to the query that is already there?

In that case, I'm getting errors.

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Maryam H2 commented ·

Either use the table.query command and clone the result to a global table

table.query(...).cloneTo(Table("tableName")) 

Rr directly in the query of a calculated table ("Enable direct editing").

WaitTimesCalcTable.fsm

0 Likes 0 ·
Maryam H2 avatar image Maryam H2 Felix Möhlmann commented ·

waittimescalctable_1.fsm@Felix Möhlmann Thanks!


I'm getting errors. Could you take a look at the attached model and let me know how I can set a table or calculated table that gives me the frequency of max wait times?



0 Likes 0 ·
Show more comments