question

Andreas BH avatar image
0 Likes"
Andreas BH asked Jason Lightfoot commented

lenght of level 1 in rack in group

Hello together,

i want to know how many items are stored in all racks in level 1 in a group of racks. I tried several different formulations but failed.

  1. for (int i = 1; i <= groupnummembers("Bereich_2"); i++)
  2. {
  3. k = Storage.system.queryItems("WHERE slot.storageObject.name==$1 AND slot.levelID == 1",0,groupmember("Bereich_2",i).name).length;
  4. j=j+k;
  5. }

it seems to me that it doesn't matter if you use == or =

Is somebody able to help?

Thank You!


FlexSim 22.1.4
racksgroupssql querylength
· 6
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 Andreas BH commented

You can do this in one line:

  1. int numLevel1=Storage.system.queryItems("SELECT count(*) WHERE slot.storageObject IN $1 AND slot.levelID=1", 0,Group("Bereich_2").toFlatArray())[1][1]
· 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.