Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

repeat record "n" times

dsouthh
7 - Meteor

Hello Community,

 

Let's say I have ten records, each with three fields. The first field will be a unique customer ID and then the remaining two fields are items purchased by this customer: one item per field.

 

For each customer, I want to have a separate record for each item. In the end, there will be twenty records but with only two fields.

 

The first step I've chosen to take is to use two select tools. One of them will select the customer IDs and the other select tool selects the purchases. The purchases are then transposed organizing them in a way I want. I now want to append this transposed table to the customer IDs but first I need to be able to duplicate each ID.

 

Is there a way to duplicate a record any amount of time? Is there a more creative way of doing this?

 

Thank you.

4 REPLIES 4
MarqueeCrew
20 - Arcturus
20 - Arcturus
Do try the Transpose tool!

https://help.alteryx.com/11.3/index.htm#Transpose.htm

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
NicoleJohnson
ACE Emeritus
ACE Emeritus

Can you just use the Transpose tool on the original data, grouping by Customer ID? See below... is that what you're looking for? You could deselect the Name column after transposing, and that would give you your CustomerID + List of items in just the two columns.

 

Original Data:

CustomerIDItem1Item2
123AD
456BE
789CF

 

Results:

Capture.JPG

 

NJ

mborriero
11 - Bolide
Hi, try to have a look at the generate rows tool. It will duplicate rows as many times as you want, based on your loop.

Get Outlook for iOS
dsouthh
7 - Meteor

Now I know how to use the transpose tool properly... thank you

Labels
Top Solution Authors