question

kiminami avatar image
0 Likes"
kiminami asked kiminami commented

How to make a SQL filter in a Global Table and capture the first result?

Hello, I'm having trouble making a SQL filter in a Globaltable and pulling the first result from it, I've tried several syntaxes and nothing works, would anyone know how to help me?

EX: Table.query("SELECT col1 FROM Globaltable1")[1][1]

FlexSim 23.0.0
global tablesqltabela
· 1
5 |100000

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

kiminami avatar image kiminami commented ·

sqlfilter[1][1] .fsm


Segue em anexo um exemplo

1674563621258.png


1674563687106.png


0 Likes 0 ·
1674563621258.png (5.6 KiB)
1674563687106.png (7.3 KiB)
sqlfilter11.fsm (28.0 KiB)

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered kiminami commented

There's a space in the default global table's column headings so if you've not renamed them you need:

Table.query("SELECT [Col 1] FROM GlobalTable1")[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.

kiminami avatar image kiminami commented ·

that's not the problem, the column name I left generic in my question only, but thanks for the answer

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ kiminami commented ·
What is the problem then? Since the syntax I provided is correct you will have to provide your model and point us to the offending lines of code.
1 Like 1 ·
kiminami avatar image kiminami Jason Lightfoot ♦♦ commented ·

I posted it above, thanks

0 Likes 0 ·
Show more comments