Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

How to create a row(s) based on a cell's value

nickrosen28
7 - Meteor

Hi everyone,

 

I have a data set that tells me which aircraft a set of parts are for, but some cells will say for example set "1-15".

In this instance i would need 15 rows that repeat all the data except have a cell for each row say what aircraft.

I.e. one row saying "1", the next row saying "2", the next saying "3". If a cell says "3-10" I would need one saying "3" one saying "4" and so on.

 

Any help will be greatly appreciated!

2 REPLIES 2
apathetichell
20 - Arcturus

excel files help .png files do not. is this always separated by hyphens? if so - you create two tools:

1) formula tool.

create field start tonumber(regex_replace([fieldname],"^(\d+)-.*","$1"))

- this should be an integer

create field end:

tonumber(regex_replace([fieldname],"^\d+-(\d+)","$1")_

 

next - generate rows. initial value is your start field

Expression is rowcount <= [end]

 

 

CoG
14 - Magnetar

Simple solution to a hopefully simple problem (change column names as desired/necessary; Included is a slight variation on @apathetichell 's solution). MVT (Most Valuable Tool) for this problem is the Generate Rows Tool followed closely by the Text To Columns Tool:

Screenshot.png

Happy Solving!

Labels
Top Solution Authors