ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 04-21-2011
Stefan Trabut Stefan Trabut is offline
Flexsim User
 
Join Date: Mar 2011
Posts: 29
Downloads: 12
Uploads: 0
Thanks: 34
Thanked 5 Times in 5 Posts
Rep Power: 115
Stefan Trabut is on a distinguished road
Default Excel: unknown number of entries

Hi,

I use the experimenter (EndOfReplication) to put all the simulation results in an Excel sheet (from an earlier generated GlobalTable). Here an example for data each FlowItem carries in its labels.

Code:
//Experimenter EndOfReplication:
excellaunch(C:/Program Files/...);
excelopen(concat(modeldir(),"RESULTS.xlsx"));
excelsetsheet(concat("ItemReplication",numtostring(replication)));
excelexporttable("GlobalTableFlowItemInformation",1,1,gettablerows("GlobalTableFlowItemInformation"),gettablecols("GlobalTableFlowItemInformation"));
excelclose(1);
excelquit();
I would like Excel calculations to be done automaticly (by making an appropriate template named RESULTS.xlsx). Here, it is unknown how many rows the excel table will have.

Column calculations such as sums are easy: to sum up a column with an unknown number of rows, one can use =SUM(X:X) for column X.

My question is, how to do row calculations for each row/FlowItem (e.g. staytime = time2 - time1). The "staytime" column then can be used for calculations (e.g. =AVERAGE(X:X), with X the staytime column).

One "heavy" solution is to fill the entire column (by copying one cell, selecting the column, and pasting) with the function =IF(NOT(A1="");B1-A1;""). Does somebody have a "lighter" solution?

Thanks

Last edited by Stefan Trabut; 04-21-2011 at 08:33 AM.
  #2  
Old 04-21-2011
Stefan Trabut Stefan Trabut is offline
Flexsim User
 
Join Date: Mar 2011
Posts: 29
Downloads: 12
Uploads: 0
Thanks: 34
Thanked 5 Times in 5 Posts
Rep Power: 115
Stefan Trabut is on a distinguished road
Default Double-click on the cross

It looks like it is possible to fill two rows which contain numbers that Flexsim could have exported, then to double-click on the cross (right-down corner of the cell with the =B1-A1 code) to expand the code to the entire data (both rows). Then, if no row is left with blank cells, and the rows are filled one by one in the descending order, the code expands automaticly to the freshly created rows.

This doesn't work always - I don't know why.


Thread Thread Starter Forum Replies Last Post
Unknown setup time of a processor Stefan Trabut Q&A 3 04-02-2011 07:22 AM
Unknown error David Chan Container Terminal (CT) Library 1 11-22-2010 12:58 PM
how to get number of itemtype Vic Li Q&A 11 08-19-2009 11:20 PM
Excel 2002 vs. Excel 2007 Nico Zahn Q&A 2 04-27-2009 01:47 AM
Setting the number of operators Sung Kim Q&A 4 02-05-2008 12:31 PM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.