question

Jimmy jang avatar image
0 Likes"
Jimmy jang asked Jimmy jang commented

pull from list question

Good day


i am making a model which using pull from list.

The push value is token.XX.subnodes.toArray()


and while pulling i have write the query

WHERE Type BETWEN Table("xx")[token.x][token.y] AND Table("xx")[token.x][token.z]
but it failed so i have change the query to

WHERE Type BETWEEN token.Min AND token.Max

but it is keep failing

may i know what i am doing wrong?


Best regards



FlexSim 24.2.1
pull from list
· 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.

@Jimmy jang, can you attach an example model? Please describe what values you are requesting from list value fields. Thanks.

0 Likes 0 ·
Jimmy jang avatar image Jimmy jang Joerg Vogel commented ·
Sorry for the inconvenience.

Currently I can not upload my file.

However to be more clear about my question.

There are item inside a Tote which has label call Type and the number is random number from 1-100.


When It arrive at picking station I want to pull item from the tote using pull from list.

The query I used initially was

WHERE Type BETWEEN 1 AND 20

However since there are multiple station which require specific range of item. For example 1st 1~20, 2nd 21~40, 3rd 41~60 .....)

So I made made a table call "range" to make a reference of Min and max of range.


So I have write the query

WHERE Type BETWEN Table("range")[token.min][1] AND Table("range")[token.max][1]

In my thinking

Table("range")[token.min][1] Is 1

and

Table("range")[token.max][1] is 20


So this query should be meaning

WHERE Type BETWEEN 1 AND 20


may I know if in query can I write as below? Or is the format is incorrect?

WHERE Type BETWEN Table("range")[token.min][1] AND Table("range")[token.max][1]


Thank you in advance

0 Likes 0 ·

1 Answer

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Jimmy jang commented

A query expects a string. You can compose a string. Instead of evaluating a table value in a query directly you can assign table values to a numerical variable and convert this into a string.

string.fromNum(num value) 
string combineStr = string1 + string2 + string3; 

If your query with static values is working, a concatenated string should work, too.

Here is an example:

Pull_between_lookup_table.fsm


· 3
5 |100000

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

Jimmy jang avatar image Jimmy jang commented ·
Thank you for your prompt reply.


Until now i have founded out that table value should be assign to token label.

Therefore, i have use each query as below and succeed

WHERE Type = puller.Min

and

WHERE Type = puller.Max


However what i need is to pull is the range between min and max

Which i was using was

WHERE Type BETWEEN puller.Min AND puller.Max

and it failed.


May i know how should i change the format?


0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Jimmy jang commented ·

@Jimmy jang, I edited my answer and attached an example

string qstr = "WHERE Type BETWEEN ";
qstr += string.fromNum(token.colMin); qstr += " AND "; qstr += string.fromNum(token.colMax); print(qstr); List.PullResult pulled = List("pushedItems").pull(qstr,5,5); token.labels.assert("pulled",pulled).value = pulled;

above is the main structure of an concatenated string for a pull query string

0 Likes 0 ·
Jimmy jang avatar image Jimmy jang Joerg Vogel commented ·
thank you it worked, still i will need to study your comments!

i really appreciate your support!

0 Likes 0 ·