Page 1 of 1

assign label to products

Posted: Tuesday 08 December, 2015 - 16:34
by christian123456
Hi all,
I would like to create with one source products which are labelled. The first one should be labelled with 1, the second with 2, the third with 3, the fourth with 4 and the 5th should start with 1 again and so on, and so on.

Would be great if somebody has an idea?!

Cheers, Christian

Re: assign label to products

Posted: Thursday 10 December, 2015 - 16:57
by HarryBunnik
Ha Christian,

What I would do is create a label and fill it using the Output(c) (This gives the number of products that have left the Source) and use a modulo:

Code: Select all

Label([?????], i) := Mod(Output(c) - 1, 4) + 1
If you place this code on the OnExit trigger of the source, it will label each outgoing product with a number of 1 to 4 under the label name ????.

The -1 and the +1 is to compensate for the fact that Mod(4,4) returns a 0, which is not what you want).

I hope this helps you further,

Cheers, Harry