question

Aravind D avatar image
0 Likes"
Aravind D asked Jordan Johnson commented

how to export values directly into excel when the model is running?

Hi, @phil.bobo @steven.hamoen @tanner.p @Matthew Gillespie

I have uploaded sample model in which i am recording the no.of items and its entry time in global table.

I want to write values directly into excel sheet when the model is running. The values must store in excel sheet instead of global table and must update automatically and simultaneously when the model is running as it does in global table.

I tired to use excel commands but i am not getting the desired output. how to use the commands properly can anyone help me with a tutorial

Thank you in advance

asd-15.fsm

FlexSim 19.2.4
excel exportautomatic
asd-15.fsm (28.8 KiB)
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 Jordan Johnson commented

You might try saving the file every time you change a value. However, even if that works (which I am not sure it does), it will be slow, since you will save the entire file to change a single value.

This feels like a bigger question, though. Why do you need the values live in excel? How do you plan to use this live view? If we understand how you want to use this in a workflow, we can help you come up with a solution.

· 2
5 |100000

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

Aravind D avatar image Aravind D commented ·

Hi, @jordan.johnson

My client expects the data to reflect in his database ( MongoDB) while the model is running. I tried using the db codes to export or import directly to database. The codes work perfectly for SQL server or MYSQL database but not for MongoDB. I have imported the values from MongoDb but i couldn’t export it to MongoDb database. So instead of showing in MongoDB i am trying to get the values in Excel.
It would be helpful if you could guide me in populating the values directly in MongoDB.This is the code i used for sample data whenever the object enters in sink the values will be stored in database

db-code.png

0 Likes 0 ·
db-code.png (11.8 KiB)
Jordan Johnson avatar image Jordan Johnson ♦♦ Aravind D commented ·

It sounds like you have a workflow that looks something like this:

The question is, what is that output layer? FlexSim doesn't natively connect to NoSQL databases, including MongoDB, so you'll need an output layer to write the data to. The issue with using Excel for that layer is that Excel is file-based, and files cannot be read and written at the same time. I recommend using an intermediate SQL database, like MySQL or postgres. Then the MongoDB can read from that database while the model is writing to it.

1 Like 1 ·
mongoworkflow.png (7.4 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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