question

Ankur A3 avatar image
0 Likes"
Ankur A3 asked Ankur A3 commented

Counting SKU type in queue and pulling the one having max content?

Hi Team,

I am creating a model where there are multiple SKUs generated randomly in queue. I have to select the SKU having max content to pull from list 1 by 1. This sequence will continue until all the item gets over for the selected SKU. Now, next SKU will be chosen based on its content in list.

Also, how can I get the # of SKU available in the queue at a given time?

I would like to know the best way to approach this problem.

Thank you!

List_Content_Count_Trial.fsm

FlexSim 23.1.0
queuecontentcountsku
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
0 Likes"
Jason Lightfoot answered Ankur A3 commented

This interpretation takes all of the matching types until there are none remaining and uses a table query to find the type with the maximum (by removing the list partitions)

Table result=Table.query("SELECT Type,count(*) AS Total FROM ItemList1 GROUP BY Type ORDER BY Total DESC");

1695040391031.png


list-content-count-trial_jl.fsm


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

Ankur A3 avatar image Ankur A3 commented ·
Thank you so much! @Jason Lightfoot

It's working well. The learning for me is to see that we can also use list as global table to apply SQL query which makes it simple.

Thank you once again for your quick response.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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