question

Borja Lorenzo avatar image
0 Likes"
Borja Lorenzo asked Borja Lorenzo commented

Time table import from Excel

Hello

I would like setting a time table from an excel sheet.

These dates don't have a structure or squence, so to load the openning and closing into a schedule, you select the schedule manaully.

Is there an automatic soluction to upload this types of dates without a patron?

How should schedule dates be prepared (type format dates, mesure time between openning and clossing or openning and clossing time) in Excel?


Thanks a lot in advance for your support.

FlexSim 24.1.0
excel importtime tableautomaticallyirregular datesupload dates
· 13
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
1 Like"
Felix Möhlmann answered Felix Möhlmann edited

I built an example that imports data structured like the marked section from your screenshot into a time table.

1720686091365.png

The code assumes that the layout follows exactly what is shown in the screenshot (column 2-6 are default values for work days, following columns store values for days that differ from these). The user command in the attached model first parses through the excel file and stores the default schedule from monday to friday and any special schedules stored in further columns.

It then goes day by day, checks if there is a 'special' entry for that day or otherwise uses the default schedule and adds it for that day. The assumptions is that the time table and model start at midnight. The code currently goes up to the next specified stop time or a maximumm of 60 days.

import-schedule-example-fm.fsm

TestSchedule.xlsx

This model is meant as an example to showcase how to read data from excel, convert date strings into a FlexSim datetime and fill out a time table schedule.

Note: If date time conversion in the command uses the windows default weekday and month names. So as long as the naming in your excel file matches this, the code should also work with other languages.


5 |100000

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