Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Generate Row based on specific data in field

lruchlin
7 - Meteor

Hello I am trying to generate a new row of data based on specific data within a column. I am trying to use the row generator, but I can't figure out the expressions I would need to use. 

 

If the Address2 field has "PO Box" then Generate a new row with "PO Box 1232"  as the Address,  and add the rest of the columns 

 

Group

Address

Address2

Address3

City

State

Zip

3372

245 Pittsburgh Road

PO Box 1232

 

Butler

PA

16003

 

Thanks,

Lloyd 

7 REPLIES 7
ivoller
12 - Quasar

How about something like

 

2018-05-11_16-44-17.png

 

Iain

david_fetters
11 - Bolide

I think @ivoller's solution is probably the one I would use because it is significantly easier to understand what is happening by looking at the workflow.  That said, I wondered if you could use the Generate Rows tool in the way you described and found out that you can.  See below!Capture.PNG

 

 

 

Treyson
13 - Pulsar
13 - Pulsar

Perhaps rather than generating new rows using the generate row tool, you can use the arrange tool. See the attached workflow.

 

edited for wording*

Treyson Marks
Senior Analytics Engineer
david_fetters
11 - Bolide

@Treyson I think I have used the Arrange tool maybe twice in my career, so I appreciate you putting an example together!

 

I did see an issue if the Address2 field contains something like 'Suite 555' in which case it still creates the new row despite not containing the text "PO Box"

 

Not sure exactly how @lruchlin is using the Address2 fields so it still may work (i.e. is it always holding a second possible address and never holding a second component of the [Address] field) but just something to keep in mind.

Treyson
13 - Pulsar
13 - Pulsar

ah yes right. Maybe add a filter before with something like Contains([Address2],"PO BOX"). then union back together after the arrangement.

 

Treyson Marks
Senior Analytics Engineer
lruchlin
7 - Meteor

Hello,

 

This will work, since my other example would be suite or other data, withch it will also arrange. 

 

Thanks,

Lloyd 

Treyson
13 - Pulsar
13 - Pulsar

@lruchlin Wonderful! Glad to help.

Treyson Marks
Senior Analytics Engineer
Labels