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

Generate Blank Rows After Each Grouping

knnwndlm
8 - Asteroid

Hi SME,

 

I would like to use the Generate tool to create a blank row after each group of data from different class so that I can see a separator between the classes with the output.  For example, I have the following dataset:

 

Year   Class    Amount

2022      A        100.30

2023      A          50.33

2022      B         212.00

2021      C         332.22

 

What I get to see is as follows:

 

Year   Class    Amount

2022      A        100.30

2023      A          50.33

 

2022      B         212.00

 

2021      C         332.22

 

 

I could do this the long way using the Transpose/Cross Tab tools. However, I want to understand how to use the Generate Tool to do this.

 

Thanks,

kwl

4 REPLIES 4
abacon
13 - Pulsar

@knnwndlm This isn't as intuitive as I am sure you would like it to be but here is a workflow that would do it for the data you provided.

 

Basically I am adding a 2nd row for each one, if the row is the last one, removing, then removing everything from those rows.

 

Bacon

 

image.png

CoG
14 - Magnetar

Here are another 2 approaches, one is clearer, leveraging the Union tool to insert blank rows as needed. The other rearranges @abacon's solution to help simplify the tool usage, but requires more complex logic:

Screenshot.png

 

Hope this helps and Happy Solving!

knnwndlm
8 - Asteroid

@CoG - How do I modify the Generate Row tool above to also insert a blank row at the bottom?  I did this the long way and it worked fine.  Just wondering if it's possible to do all that in the Generate Row tool above in one swoop.  Thank you!

CoG
14 - Magnetar

By modifying the Multi-Row Formula Tool:

Screenshot_2.png

 

I added a Record ID Tool as well with Sort Tool to preserve ordering with AMP.

 

Labels
Top Solution Authors