question

Thomas K4 avatar image
0 Likes"
Thomas K4 asked Abdullah A commented

How to find the rownumber in my GlobalTable by flow item labelmachting?

Hi! In the GlobalTable2, i have a list of all available articlenumbers (Artikelnummer). So when the flowitem arrives in the rack, I want to write in my GlobalTable2 in the second column the amount, so +1 for each. For this I have to match the label item.Artikelnummer to the Artikelnummer (values in the first column) in the Global Table, to find the row.

What do I have to write in the marked line? Picture below

Maybe someone can help me with this.

Thank you!


FlexSim 21.1.2
flexsim 21.1.2label matching to find row in the global table
inkedsc-li.jpg (949.7 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

Ralf Gruber avatar image
1 Like"
Ralf Gruber answered Abdullah A commented

Hi Thomas,

there is no picklist option to find a matching global table value for a given label value. I suggest you get familiar with the use of SQL in FlexSim:
User Manual/Reference/Developer and Advanced User Reference/SQL

The function you will have to look at is ROW_NUMBER(). So, this is not a single line of code, but rather a little piece of code where you also will have to consider:

- that now match is found

- that more than one match are found

Good luck

· 7
5 |100000

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

Joerg Vogel avatar image Joerg Vogel commented ·

@Ralf Gruber,

Hi @Thomas K4, I think you need the method of table getRowByKey.This method returns the row number of a table matching the key value of a column.

Table(“GlobalTable2”).getRowByKey(item.Artikelnummer,1)

I assume all Artikelnummern are in column 1. If it is so, you would not need to declare the column though.

2 Likes 2 ·
Ralf Gruber avatar image Ralf Gruber ♦ Joerg Vogel commented ·

I do agree that getRowByKey is the easier method, assuming your SKUs (Artikelnummern) are unique in the table. If you have the same SKU in two different rows the first match will be returned. If the SKU is not found at all 0 will be returned.

1 Like 1 ·
Joerg Vogel avatar image Joerg Vogel Ralf Gruber ♦ commented ·

Alternatively you can move your found row depending on a condition to the end of your table. If you search the table again for a same SKU (Artikelnummer) you find the next occurring cell. @Ralfs' answer has got more opportunities to filter found rows for items in a slot or age of content.

0 Likes 0 ·
Thomas K4 avatar image Thomas K4 Joerg Vogel commented ·

Thank You!

0 Likes 0 ·
Abdullah A avatar image Abdullah A Joerg Vogel commented ·

Just want to give a HUUUGE Thank you! This solved a similar problem I had.


THANK YOU!!!!


You can tell by the CAPS that this problem was very frustrating!

0 Likes 0 ·
Thomas K4 avatar image Thomas K4 commented ·

Hi Ralf,

okay thank you for the answer. Now I just don't my mistake :S

Thank you for your help!


0 Likes 0 ·
1620409338785.png (26.6 KiB)
Ralf Gruber avatar image Ralf Gruber ♦ Thomas K4 commented ·

You are missing the closing bracket for GlobalTable(...

And GlobalTable is not a Command. You have defined a table object "GlobalTable2" in line 23, so you can use it as GlobalTable2[row][col].



0 Likes 0 ·