How to link global table cell value to calculated table?

How to link global table cell value to calculated table?

rajankur6494
Collaborator Collaborator
98 Views
2 Replies
Message 1 of 3

How to link global table cell value to calculated table?

rajankur6494
Collaborator
Collaborator

[ FlexSim 20.0.10 ]

Hi Team,

I have to multiply my calculated table results by int variable which is defined in input global table?

I don't see any direct option available. Is there any way to do it?

Thank you!

0 Likes
Accepted solutions (1)
99 Views
2 Replies
Replies (2)
Message 2 of 3

logan_gold
Community Manager
Community Manager
Accepted solution

Depending on how you have your calculated table set up, you may be able to create a new Metric (or modify an existing Metric) in the Calculated Table Properties with the "Basic math operations" > "Operation on column and value" option:

calculatedtablemetric-mathoperation.png


Then, you can reference a global table (and probably other tables like statistics collectors) as the value:

calculatedtablemetric-mathoperationvalue.png


Or, if you want to directly edit the query in your calculated table, you can do this:

SELECT
   ([Column 1] * {Table("GlobalTable1")[1][1]}) AS [Metric 1]
FROM [DataSource]

Where anything between the curly brackets, { }, is assumed to be FlexScript that is executed when the query is called.

You could also create a second calculated table that uses the first calculated table as it's primary table and set up the same kind of metrics as above. But this will all depend on how you have your calculated table set up in your model. So if you can't get it to work and need more help, please attach an example model and/or give us some more details about your model.

0 Likes
Message 3 of 3

rajankur6494
Collaborator
Collaborator

Thank you so much @Logan Gold

0 Likes