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

Create a new row based on a condition

Serena3
6 - Meteoroid

I have a table with fields Full Name and Category. There are three categories (1,2,3)

Basically I want each name to be repeated each time to have a row with category 1 another with 2 and another with 3 like below.

 

Full NameCategory
John Smith1
John Smith2
John Smith3
Serena Tang1
Serena Tang2
Serena Tang3

 

The only thing is some people in the column already have three rows while some only have two (for category 1 and 2).

So I want a condition that says if the value in [Full Name] does not have 3 in [Category] then create a new row with the Full Name and Category = 3 (with all the other columns I have in the table remaining blank)

 

How can I go about doing this?

 

Thanks!

5 REPLIES 5
RolandSchubert
16 - Nebula
16 - Nebula

Hi @Serena3 ,

 

maybe a solution is to generate all rows needed for each name and add the previously non-existing rows to your table:

 

27-09-_2019_10-28-16.png

I attached a sample workflow. Does this help?

 

Best regards

 

Roland

Serena3
6 - Meteoroid

Brilliant! This does the trick, thank you so much!

Serena3
6 - Meteoroid
 
RolandSchubert
16 - Nebula
16 - Nebula

if you add a SELECT tool between the Input tool and the Unique tool to remove all values except Name and Category, the additional values aren't replicated any longer. I've done that in my sample workflow and attached the new version.

Serena3
6 - Meteoroid

Awesome thanks!

Labels