Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Repeating First Row After Each Change In A Certain Column

BrandonS4
8 - Asteroid

I am wanting to repeat the first row of my data after each change in a certain column.  I have an example below of what the first row is.  After each change in state, I want to repeat Customer, Amount and State.

 

CustomerAmountState
ABC Inc   1,500.00CA
Tester 1   2,500.00CA
Tester 2   2,160.00NY
12234 Co      987.00FL

 

 

This is what I want the data to look like:

CustomerAmountState
ABC Inc   1,500.00CA
Tester 1   2,500.00CA
CustomerAmountState
Tester 2   2,160.00NY
CustomerAmountState
12234 Co      987.00FL

 

So how do I repeat the first row after each change in state?

 

Thanks!

3 REPLIES 3
binuacs
21 - Polaris

@BrandonS4 One way of doing this with the batch macro

binuacs_0-1682982813159.png

 

ShankerV
17 - Castor

Hi @BrandonS4 

 

One way of doing this.

 

ShankerV_0-1682984531737.png

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @BrandonS4 

 

Step 1: Input

ShankerV_0-1682984935199.png

 

Step 2: 

 

ShankerV_1-1682984952462.png

Step 3: 

 

ShankerV_2-1682985020090.png

IF [State]=[Row-1:State]
THEN 0
ELSE 1
ENDIF

 

ShankerV_3-1682985032737.png

 

Step 4: 

 

ShankerV_4-1682985058654.png

ShankerV_5-1682985068248.png

 

Step 5:

 

ShankerV_6-1682985088170.png

 

ShankerV_7-1682985126864.png

 

 

Step 6:

 

ShankerV_8-1682985143741.png

ShankerV_9-1682985156424.png

 

Step 7:

 

ShankerV_10-1682985183979.png

 

ShankerV_11-1682985195295.png

 

Step 8:

 

ShankerV_12-1682985239569.png

 

ShankerV_13-1682985249969.png

 

Step 9:

ShankerV_14-1682985267675.png

 

ShankerV_15-1682985277107.png

 

Step 10:

 

ShankerV_16-1682985292866.png

ShankerV_17-1682985303008.png

 

Many thanks

Shanker V

Labels
Top Solution Authors