question

Łukasz E avatar image
0 Likes"
Łukasz E asked tannerp answered

Import data from Global Table to Financial Analysis

Hello,

I would like to import data from GlobalTable to Objects in Financial Analysis.

I want to import Object Values: Fixed and Amount per Time
and FlowItems: Amount per Entry and Amount per Time

So I've created a Global Table and using the Script I import the data (Row 1&2) (Fixed and Amount per Time) from GlobalTable to Processors 1 & 2 (in Financial Analysis)

(Globat Table)

From rows 3-7 I import the FlowItem data to Processors 3&4

Importing data to Processors 1 - 3 works fine, but there is an Error:
exception: FlexScript exception: Invalid row number: 4 in MODEL:/Tools/Statistics/Financial Analysis>variables/objects/3/3 at <no path> c: <no path> i: <no path>

And I think it is connected with Processor 3, so that's why the Script is not working for the Processor 4.

Do you know how to solve this problem and how to import data correctly?

import-global-table-1.fsm

FlexSim 19.1.1
global tableimport datafinancial analysis
m4g7k.png (3.6 KiB)
dayiv.png (12.5 KiB)
konsl.png (7.5 KiB)
kdswp.png (6.9 KiB)
· 3
5 |100000

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

Łukasz E avatar image Łukasz E commented ·

Any ideas how to solve this?

0 Likes 0 ·
tannerp avatar image tannerp commented ·

Another potential obstacle is that the values you are working with are arrays and not individual values. This is demonstrated with the image below:

You can see that while the 1st, 3rd, and 4th node are values, the 2nd node has an array inside. That will cause your script to throw errors and then the table won't work properly.

Is there any reason why you can't just enter the values by hand? It would probably be faster to enter them yourself than have a custom code do it.

0 Likes 0 ·
error-for-loop.png (10.2 KiB)
Joseph Gillespie avatar image Joseph Gillespie commented ·
@Łukasz E

Were Tanner's responses helpful for you? Do you still need help with this question?

0 Likes 0 ·

1 Answer

tannerp avatar image
0 Likes"
tannerp answered

Hi Lukasz,

I'm not sure if this is causing the exception you're looking at, but could you explain why you're looping through based on numRows (which is 7 times) and then you're starting at [i+2]?

There are only 7 rows available, so by starting at row 3 and looping 7 times, you end up at row 9, which doesn't exist. Maybe I'm interpreting your code incorrectly, though.


5 |100000

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