Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Split original row into multiple rows based on information from original row

jonasheise
8 - Asteroid

Hi There!

 

I am looking for a way to split my original row into multiple rows based on specific information in that row.

 

Example

If my data looks like this.

DateDescriptionNumberAmount
01-01-20181-5kg5100

 

I want it to generate rows automatically based on the value in "Number" and then split the value in the column amount evenly out to the generated rows. Furthermore, when done the original row should be removed.

 

So my output would look like this.

DateDescriptionNumberAmount
01-01-20181-5kg120
01-01-2018

1-5kg

120

01-01-2018

1-5kg120

01-01-2018

1-5kg120

01-01-2018

1-5kg120

 

 

Hope you can help me.

 

BR

3 REPLIES 3
Kenda
16 - Nebula
16 - Nebula

Hey @jonasheise!

 

I think the tool you need is the Generate Rows tool. The configuration I would recommend looks like this:

jonasheise.PNG

 

This will generate however many rows it needs until the RowCount field equals your Number field. Next, I would add a Formula tool with the following expression:

[Amount]/[Number]

jonasheise2.PNG

jonasheise
8 - Asteroid

Hey @BarnesK

 

Thanks for quick reply! I think you almost helped me to my goal, however I encounter this problem. Can you help me out? 

image.png

 

Futhermore, would the equation/function in the formula tool have to look different If I got a data table like this?

 

DateDescriptionNumberAmount
01-01-20181-5kg5100
02-02-20185-10kg7300
    
Kenda
16 - Nebula
16 - Nebula

@jonasheise 

 

For the error, I would say make sure the RowCount field you are creating is a numeric data type and the Number field flowing through it also a numeric data type.

 

Also, everything should work as expected regardless of the number of records flowing through. Depending on how many decimal places you want, you may have to adjust the data type of your Amount field. Below I made it a double using a Select tool before the Formula.

 

jonasheise4.PNG

 

jonasheise3.PNG

Labels