Alert: There is a planned Community maintenance outage October 16th from approximately 10 - 11 PM PST. During this time the Alteryx Community will be inaccessible. Thank you for your understanding!

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
19 - Altair

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
13 - Pulsar

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