question

MarianCretu avatar image
0 Likes"
MarianCretu asked Joseph Gillespie edited

Trouble with random pull

Hello all,

Please help with this matter.

I have 4 queues in a Fixed Resource list.

I want to pull a random queue with queue size < 2 by using this query "WHERE queueSize < 1 ORDER BY Random ASC".

The problem is that it always pulls the first queue.

Please advise.random-pull.fsm

FlexSim 19.1.1
fixed resource listsql random
random-pull.fsm (30.9 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

Joseph Gillespie avatar image
0 Likes"
Joseph Gillespie answered

@CRETU M

Your problem was with "Random ASC". This code should do the trick:

WHERE queueSize < 1 ORDER BY RAND()

Let us know if you have any more questions!

5 |100000

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