question

Tzu Hsuan C avatar image
0 Likes"
Tzu Hsuan C asked Eric M commented

When to use "Values by case" and "by Expression" ?

I'm a beginner in FlexSim. I got confused when setting Processor properties.

I would like to know that what's the difference between "Values by case" and "by Expression" ?

When will each of them be used ?

FlexSim 21.1.2
processorflexsim 21.1.2properties
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

Eric M avatar image
1 Like"
Eric M answered Eric M commented

Hi @Tzu Hsuan C, they are similar in some cases and can be interchangeable at times. 'by Expression' is more limited in that whatever your expression is has to match up with the number of ports you have. For example, if you had a label called type on the items that ranged from 1-3, you could use the expression 'item.type' to send the item to 3 output ports and they would follow the number on type (type 1 would go to output port 1, 2 to port 2, etc.).

'Values by case' takes a little more time to set up, but is more flexible. Let's say you had a label with sku numbers that you wanted to send to certain ports. 'Values by case' allows you to choose which sku number goes to which port regardless of whether or not the numbers match up. So a sku of 18653 could be sent to any port of your choosing whereas 'by Expression' would want to send that item to port 18653 (which would be bad).

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

Tzu Hsuan C avatar image Tzu Hsuan C commented ·

Hi @Eric M. Thank your for your answer!

I think I could understand your explanation.

You mentioned above that in some cases and can be interchangeable at times. So users usually decide which one to use by themselves? The only difference is that 'Values by case' is more flexible?

I ask this question because I'm not really sure if there exist specific situation that can only use 'by Expression' or 'Values by case' ?

Thanks again!

0 Likes 0 ·
Eric M avatar image Eric M Tzu Hsuan C commented ·

Yes, there are often multiple ways of accomplishing the same thing. I've attached a model to demonstrate. Notice the small difference between the two models on the right side, the 'by expression' one has the actual port connections switched from Queue13 whereas the 'values by case' doesn't have the port connections switched but accomplishes the same thing.

send to port.fsm

The second example I gave with the sku # would be something that wouldn't work with 'by Expression' but could easily be done with 'Values by case.' As you use them more and experiment with them you'll start to see how they work.

1 Like 1 ·
send-to-port.fsm (37.2 KiB)