question

Durga Ghosal avatar image
0 Likes"
Durga Ghosal asked Durga Ghosal commented

how to sum values of a label in a list by partition id

how to sum values of a label in a list by partition id or buy another label value.

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

Sebastian Hemmann avatar image Sebastian Hemmann commented ·

It sounds a bit like you are looking for a "Batch" Activity instead of a List. But maybe you can explain more exactly what you are trying to do (e.g. with a small example model)? So we can figure out how to help you!?

0 Likes 0 ·
Durga Ghosal avatar image Durga Ghosal Sebastian Hemmann commented ·

@sebastian.hemmann, I am using list as my inventory/storage, I want to check how much I have in my inventory for each SKU before giving production request, so that I can prioritize the one with low inventory and ignore/delay the one with high inventory. I would just like to check the value and not release anything.

0 Likes 0 ·
Joerg Vogel avatar image
3 Likes"
Joerg Vogel answered Durga Ghosal commented

In fact it is a Table.query you are looking for.

double sumlabel = Table.query("SELECT SUM(label2) FROM List1.2")[1][1];
print(sumlabel);

List1 looks like this picture:

The value of variable sumlabel is 40.

Please look into the manual howto get a reference of a partition of a list :

Reference Developer and Advanced User Reference SQL Queries Chapter: Table Selection blue box: Quering Global Lists


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

Durga Ghosal avatar image Durga Ghosal commented ·

Thank you, worked like a charm. I deleted the partition Id and did "group by" in the query statement and it made it even more easy to use.

1 Like 1 ·
tannerp avatar image
0 Likes"
tannerp answered tannerp commented

You could try using the information found in this part of the FlexSim User Manual:

This could be applied to a dashboard or other function so you can read the value.


list-entries.png (22.9 KiB)
· 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.

tannerp avatar image tannerp commented ·

Here's a specific example where I'm finding the number of items in Partition ID: 3 of "ItemList1" that can be applied with code:

int partID3 = List("ItemList1").entries(3).length;
return partID3;
0 Likes 0 ·