General Discussions

Discuss any topics that are not product-specific here.
SOLVED

Generate Rows based in a % of data

higorpires
5 - Atom

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!!!!!

3 REPLIES 3
Yoshiro_Fujimori
15 - Aurora

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.

RegionCount
CO18
N18
NE18
S18
SE108
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.

Community_1194832_1.png

Yoshiro_Fujimori
15 - Aurora

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.

higorpires
5 - Atom

It worked perfectly!!

Thank you so much for your help.

Labels