question

Junseok K avatar image
0 Likes"
Junseok K asked Jacob W2 commented

Sum of values in Global table

Hi, is there a way to sum up values in the global table dynamically and display the total somewhere? Pls find the screenshot of the global table! Thanks


capture.jpg


FlexSim 22.1.2
global tablesumdynamic fields
capture.jpg (30.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

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Jacob W2 commented

You could write a loop or you can use the table query to do it for you. Here's an example you can run in the script window and see the result:

Table result=Table.query("SELECT SUM([Col 1]) FROM GlobalTable1");
return result[1][1];


· 7
5 |100000

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

Junseok K avatar image Junseok K commented ·

Perfect, thanks Jason! Do you know how to we can add the number to the Dashboard?

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Junseok K commented ·
Are you thinking it would be dynamic as the table values change? Or calculated on a button press?
0 Likes 0 ·
Junseok K avatar image Junseok K Jason Lightfoot ♦♦ commented ·

ideally it would be dynamic!

0 Likes 0 ·
Show more comments