How to import different excel files for different scenarios?

How to import different excel files for different scenarios?

david_vc
Not applicable
8 Views
4 Replies
Message 1 of 5

How to import different excel files for different scenarios?

david_vc
Not applicable

Hi

I am currently struggling to get a grip on how I should import excel files to flexsim for different scenarios.

The problem is as follows: i have a global table: "rack_location" which gives the location of an item on a rack corresponding to its sku-id. Now I need to import different excel sheets for this rack_location globaltable for every different scenario. How should I do this such that I can control which sheet gets read in based on globalvariables defined by the scenario. ( an example of the globalvariable is for example: storage policy. This gives different locations for an sku for every different storage policy. )

Also I have a lot of excel sheets so it would be awesome to make this "automated".

Best regards

David Van Crombrugge

0 Likes
Accepted solutions (1)
9 Views
4 Replies
Replies (4)
Message 2 of 5

joshua_s
Not applicable
Accepted solution

Use this code

excelopen("FileName.xlsx");//ie "C:/Users/user/Documents/Book1.xlsx"
excelsetsheet("Sheet"+numtostring(Sheet));//Global Variable named Sheet 
excelimporttable("GlobalTable1",num_startRow,num_startCol,num_Rows,num_Cols);
excelclose(0);

Replace what you need with your sheet names and global variable names. Your Global Table will need to have the same number of rows and columns as your sheets for it to import correctly with this method.

0 Likes
Message 3 of 5

david_vc
Not applicable

Hey @Joshua S

Many thanks!!! Where do I need to place this code to make sure my globaltables are adapted before the actual simulation run when a new scenario in the experimenter is started?

Best regards

0 Likes
Message 4 of 5

joshua_s
Not applicable

I would put it on a model reset trigger.

16542-pic1.png

0 Likes
Message 5 of 5

david_vc
Not applicable

Thanks a lot!

0 Likes