Hello, guys!
I am dealing with a data base which has 25% of order ids without region registered.
My goal is to distribute randomly 5 regions (N, NE, CO, SE, S) based on the database proportion by region.
E.g.: 60% of my orders are from SE. Therefore, I want 60% of the order ids without region information allocated randomly in the region SE.
Can someone help me? I am desperate!!!!!
Solved! Go to Solution.
Hi @higorpires ,
I created a sample workflow to meet your requirement. Please see if it works.
Input data
It has the following number of orders.
We want to assign Region to the order with no Region.
Region | Count |
CO | 18 |
N | 18 |
NE | 18 |
S | 18 |
SE | 108 |
Null() | 60 |
Workflow
The idea is as below;
1. We randomize the order of the orders with no Region.
2. We calculate the number of orders to be added for each Region and generate rows for each Region with the calculated number of orders.
3. Join them.
By the nature of rounding, there is a possibility that the total number of records generated by Generate Rows Tool may not match with the actual number of records.
There should be some ways to avoid it, but I would leave it for now.
It worked perfectly!!
Thank you so much for your help.