question

Scott Ainsworth avatar image
0 Likes"
Scott Ainsworth asked Joerg Vogel commented

How to query by text label

If I pull from a list and use a query like:

WHERE BatchVal = Puller.Batch

It works fine if the BatchVal label is a number and Puller.Batch is a number.

If I query:

WHERE BatchText = Puller.Batch

It does not work if BatchText and Puller.Batch are text labels.

However if I query

WHERE BatchText = "The text"

It does work. However, I'm stuck with static query that does not modify for the next incoming token.

I would like to query the batch with a text label so I can pull the tokens with matching text label.

FlexSim 18.2.2
pull from listqueries no result
· 4
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 ·

Would you be able to upload your model or a small recreation of the problem? It would make it easier for us to recognize what needs to happen and provide a good solution.

1 Like 1 ·
Jeff Nordgren avatar image Jeff Nordgren commented ·
@Scott Ainsworth

Does (token.Puller.Batch) work?

0 Likes 0 ·
Scott Ainsworth avatar image Scott Ainsworth Jeff Nordgren commented ·

No it does not work. I'll try to pull an example together. All the documentation on queries in the manual use numbers.

0 Likes 0 ·
tannerp avatar image tannerp Scott Ainsworth commented ·

Is your data type set as "string" and not "number"? An example of how to change/verify this is shown in this image:

-1 Like -1 ·

1 Answer

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joerg Vogel commented

I haven't got any problems to pull by strings from a list. Please see attached model.

pull-by-string.fsm

WHERE Puller.batch = batchId 

This works, where batchId is a list entry of string values, Puller is the token, batch is a label at the token containing a string.

The result contains a NULL if there is not a possible match.


pull-by-string.fsm (23.7 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.

Guillaume V avatar image Guillaume V commented ·

@Joerg Vogel
In your Query:

  1. WHERE Puller.batch = batchId

You call the list by its name "batchId". What if "batchId" is kept inside of a label known by the puller inside "ListName".
I tried writing:

  1. WHERE Puller.batch = Puller.ListName

Where Puller.ListName = "batchId" but it doesn't work :(

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Guillaume V commented ·

Please ask a new Question. Your request hasn't got any relevance to the original question.

0 Likes 0 ·