question

Marian Cretu avatar image
0 Likes"
Marian Cretu asked Marian Cretu commented

Count arrays in a table

Hello guys,

I haave a table where I store as an array all pallet details(code,batch,exp_date etc).

I need a querry to count the sku's and sort by quantity.

Here is the model.

The query works if the values are integers but when I switch to arrays it doesnt work anymore.

Please advise.


Tahnk you.count array.fsm

FlexSim 19.1.2
flexsim 19.1.2
count-array.fsm (21.1 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

·
Phil BoBo avatar image
0 Likes"
Phil BoBo answered Marian Cretu commented

@Marian Cretu,

What did you expect it to do with these arrays? An Array is an object. Each one of them is unique, even if they may contain values that are the same as a different Array. Did you expect it to concatenate all the values and then compare that, where each set of concatenated values is the same?

Like this?

count-array_1.fsm


1588811997835.png (16.7 KiB)
count-array-1.fsm (21.5 KiB)
· 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.

Phil BoBo avatar image Phil BoBo ♦♦ commented ·

If you want to COUNT or GROUP BY a column, then that column's values need to be comparable literal types, not complex objects like Arrays.

0 Likes 0 ·
Marian Cretu avatar image Marian Cretu commented ·

Exactly what I want. Thank you.

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.