question

Steven Chen avatar image
0 Likes"
Steven Chen asked Jordan Johnson answered

Calculated Table : Export to Excel and Update Programmingly

Hello,

I would like to export result of calculated table to excel, I set table type to Other then use sample tool to select calculated table from toolbox, but nothing exported.

Is there a way to update calculated table programmingly if the table only need to calculate at simulation end.

FlexSim 17.2.2
calculated table
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

Jordan Johnson avatar image
1 Like"
Jordan Johnson answered

If you use the exporttable() command on either a CalculatedTable or a StatisticsCollector, it will update the table, and then write the table to CSV.

We don't have a direct way of exporting StatisticsCollectors or CalculatedTables to Excel (yet), but to update the table, you can use:

function_s(myCalcTable, "update")

If you write your own export code, remember to look up the column format (collector>variables/columns/format or calcTable>variables/dataFormats) and apply it:

0 - No Format

1 - Object Format. Use IDService.getPathFromID() to get the path from an ID value.

2 - DateTime Format. Use the convert() command to get the string

3 - Percent format. I think you can actually just export this value as it is, and then in Excel, format the column as percent

5 |100000

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