Setting up a router

Hi Make

Can you tell me how I can set the router condition:

a. Option 1 is fulfilled, say, in 70% of cases, and option 2 - in 30%

b. Option 1 is performed, say, in 70-80% of cases, and option 2 - in 20-30%

Or can it be done through another module?

1 Like

Dear Rory,

Are you mean balance the data using router or are you try route based on the previous data? Give more details about that

Please don’t hesitate to contact us if you need any additional help.

Cheers
//HFBR

1 Like

I’m try route based on the previous data.

In the previous step, the scenario publishes a message in the telegram channel. Next, there are two different options. I would like to make sure that they are reproduced in a given percentage. For example, 70/30 or in the range of 70-80/30-20.

I understanding. If I am not wrong, what you are want to doing is a balance for the cases to distribuite it between the options. This solution is more complex. You need a datastore again and do some calculation based on the message history. Its a very complex coding to build. It will takes some hours to you find the better solution. The router is part of the process but the balance must be a custom code with 1 or several other steps. I hope you can find this solution soon.

Please don’t hesitate to contact us if you need any additional help.

Cheers
//HFBR

1 Like

I will look for a solution. Thank you.

@Rory Can you share a loom recording of the above problem so we can understand the problem better.

Surely, we can help you with a solution.

MSquare Support
Visit us here
Youtube Channel

@Msquare_Automation I have already described the essence of the problem. What exactly would you like to clarify?

@Rory

The following will give you exactly 75% on one route and 25% on the second

Add an Increment Function Module before the router and set it to Never reset

Then add the filters as per my image below. Ignore tha fact that the last modules in mine are increment functions, just leave yours as they are

3 Likes

If you are considering the entire data that keeps on coming to the scenario, then you can simply use modulus function in filter - based on percentage you can use the mod value to apply.
Eg: (Increment value)mod(4 - for 75%)

1 Like

Would the 25% filter then be mod1 (25% of 4)?

@Andrew_Mein It really works. Thanks a lot :+1:

1 Like

You’re very welcome, glad you found it helpful

1 Like

@Msquare_Automation @ryan_rockwood Solution found. Thanks for responding.

2 Likes

Please share the solution if not described here and you are able!

The solution is described just above in the post from @Andrew_Mein

2 Likes

@Andrew_Mein

In the work of this scenario, I noticed the following feature. If, for example, you run the scenario 8 times, then option A always works the first 3 times, as well as on the 5th, 6th and 7th time. Option B always works on the 4th and 8th time.

For clarity:

1 - A
2 - A
3 - A
4 - B
5 - A
6 - A
7 - A
8 - B

Can you please tell me how can I set up the scenario in such a way that option B can work in any of the 8 cases in the range from 1 to 8? In other words, so that both options (A and B) work randomly in a given proportion (75% / 25%), and not predictably.

That is probably a little bit trickier, but let me have a think and see if we can randomize it.

2 Likes

@Rory

Try the changes shown in the image below

Make the second module a “Set Variable” instead of the Increment one, and apply the filters as shown. This should rendomise it and give on average 75/30 split

2 Likes

It works. But for some reason this scenario does not always work correctly :thinking: For example, like this

1 - B
2 - A
3 - B
4 - A
5 - B
6 - B
7 - B
8 - A
9 - A

@Rory
Ah ok it’s because it’s based on every 100 runs. Are you trying split 70/30 for every run of the scenario. Rather than over a period of time and multiple runs.

In that case the random seed will need to be altered to match the number or bundles in the particular run of the scenario. You would also need to amend the filters so they run 75% or 25% of the bundle number. Does that make sense

1 Like