question

Shinya O avatar image
0 Likes"
Shinya O asked Shinya O commented

order by the smaller of field1 and field2

Hi,

Is it possible to sort the list in ascending order by the smaller of field 1 and field 2? I tried the following query:

ORDER BY min(field1, field2) ASC

However, the below error was returned to the compiler console and system console.

Too many parameters in function min
time: 0.000000 exception: Exception caught in start() of activity "Pull from List" in process flow "ProcessFlow". Continuing throw...
time: 0.000000 exception: Exception caught in Executive::processeventinlist().

Is it better to prepare the smaller of field1 and field2 as field3?

Thanks in advance.order by the smaller of field1 and field2.fsm

FlexSim 24.0.4
querypull from listorder by
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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Shinya O commented

"min" is also an SQL keyword, so it is interpreted in that way. You can work around this by creating a user command that does the same as min() and use that in the query.

order-by-the-smaller-of-field1-and-field2_1.fsm

As long as the field values are not dynamic I would recommend to indeed prepare a "field3" that already contains the minimum, if only to save a tiny bit of computation time, because the comparison doesn't need to run every time something is pulling from the list.


· 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.

Shinya O avatar image Shinya O commented ·

Actually, in my model, the field values are dynamic. Anyway, thanks for the information. I understand what the error means.

0 Likes 0 ·