"Group by" field - Batch activity

"Group by" field - Batch activity

emmanuelvasquezsand
Participant Participant
88 Views
6 Replies
Message 1 of 7

"Group by" field - Batch activity

emmanuelvasquezsand
Participant
Participant

[ FlexSim 21.0.10 ]

Hello everyone,

I have a question regarding the "batch" activity. Is it possible to include more than one join criteria ("Group By" field)? I'm thinking in two or more labels.

I look forward to your response, thanks in advance.


1679414259530.png


0 Likes
Accepted solutions (1)
89 Views
6 Replies
Replies (6)
Message 2 of 7

jason_lightfootVL7B4
Autodesk
Autodesk
Please give an example with example labels and how they would aggregate.
0 Likes
Message 3 of 7

emmanuelvasquezsand
Participant
Participant

Hello @Jason Lightfoot

I attach a simple model where there are 2 labels (testA and testB), where each one can have two possible values (1 or 2).

Is it possible for the "Group by" field to consider both labels? For this example, this would define four possible batch IDs:

(testA, testB) : (1,1), (1,2), (2,1), (2,2).

Groupby-batch.fsm


0 Likes
Message 4 of 7

moehlmann_fe
Explorer
Explorer

In your given example, you would have to join the two labels into a single, unique value in some way.

One example would be to simply connect them together as strings, which will work for arbitrary values.

string.fromNum(token.testA) + string.fromNum(token.testB)

If you know that the numbers are integers and will always fall into a certain range, you can also combine them into a unique number by shifting the decimal point of one of the labels by a sufficiently large margin.

token.testA*10 + token.testB

groupby-batch_1.fsm

0 Likes
Message 5 of 7

JordanLJohnson
Autodesk
Autodesk
Accepted solution

You can use an Array:
1679929687763.png

When you enter the Array, you'll get an exception that says "Arrays are not valid in this field". However, this is a UI-level exception. The array actually works just fine. I'll add an issue to the dev list to remove that check.

.


Jordan Johnson
Principal Software Engineer
>

Message 6 of 7

emmanuelvasquezsand
Participant
Participant
Hi @Felix Möhlmann

The idea you mention is a great alternative solution.

Than you very much for answering.

0 Likes
Message 7 of 7

emmanuelvasquezsand
Participant
Participant
I tried this option and it works correctly. Great solution!.


Than you very much for answering.


0 Likes