In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
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