question

Joerg Vogel avatar image
0 Likes"
Joerg Vogel asked Jordan Johnson answered

How can I evaluate attributes of the content of a queue in a SQL query?

I am trying to get sum of the physical length of all items in a queue. I think a "SUM" clause will do that, but I can't get even a reference to a single item in the queue. I tried the adjusted approach in Flexsim 16 and it worked. In the current version Flexsim 17.2.2 I get a table which contains "no data" entries. I have tried to cast the queue into different datatypes, which doesn't change anything, I have tried to get a reference by a rank, that doesn't work neither. The Tutorial method does not work from the section "Advanced Query Techniques" under "SQL queries". Passing the Flexscript function in Dot-syntax or classic structure makes no difference. If I execute the code in a script window, doesn't change anything. What is the current syntax to query the items in a queue?

FlexSim 17.2.2
queuequerysqltutorialsno data
· 4
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
0 Likes"
Jordan Johnson answered

To get the length of all the items in a queue, I used this code:

  1. Table.query("SELECT SUM($2) FROM $1", model().find("Queue1"), $iter(1).as(Object).size.x)[1][1]

I couldn't replicate the issue on my machine (17.2.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.