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.
SOLVED

Adding a row after certain condition met

tjamal1
8 - Asteroid

Hello,

 

I have a table which contain sequenceID , Minutes and Running sum of Minutes.

 

I want to add a row, 

- when Running sum of minutes greater than 20,40,60,80 ...  (after each multiples of 20)

 

How can I do this in Alteryx 

 

Sample data

 

SeqDuration(inMins)RunTot_Duration(inMins)
14.5221724894.522172489
21.5996800646.121852553
31.5996800647.721532617
41.5996800649.321212681
51.59968006410.92089274
61.59968006412.52057281
74.81442173117.33499454
83.23012320620.56511775
98.72699306329.29211081
106.15E-0229.35363696
110.95365542330.30729239
120.39992001630.7072124
135.61992216936.32713457
142.95325550339.28039008
153.90691092643.187301
161.55353544744.74083645
171.58333333346.32416978
185.55839601351.88256579
199.72113269761.60369849
201.23052312662.83422162
214.72779290367.56201452
220.21534154767.77735607
231.16666666768.94402273
244.29710980973.24113254
253.68184824676.92298079
263.65108516880.57406596
274.14329441884.71736037
7 REPLIES 7
cgoodman3
14 - Magnetar
14 - Magnetar

 Do you want this new row to contain any data or just to be blank?

 

How I would approach this is to use the tile tool. With this tool there is a configuration to set manual values as your cut offs, so this would be 20,40,60 etc. This will then create two new fields called Tile_Num and Tile_Seq which can later be used to sort your data.

 

Next you need to create a fake row, so using the summarize tool you can group by Tile_num and get the max for your Tile_seq. Using a formula tool you can increase the max tile sequence value by 1. Unioning this data with your original data and then sorting will insert the blank rows where you want them.

Chris
Check out my collaboration with fellow ACE Joshua Burkhow at AlterTricks.com
Emil_Kos
17 - Castor
17 - Castor

Hi @tjamal1,

 

I have created a workflow for you.

 

Emil_Kos_0-1611646205760.png

 

Output:

Emil_Kos_1-1611646239373.png

 

If this was helpful please mark my post as an answer!

tjamal1
8 - Asteroid

Thanks, @cgoodman3 for the reply.

The new row should be blank.

 

Can you provide a workflow based on my data?

tjamal1
8 - Asteroid

Thanks @Emil_Kos for the solution.

Can you attach the workflow?

Emil_Kos
17 - Castor
17 - Castor

Hi @tjamal1,

 

I have also replicated the @cgoodman3 as this sounds very interesting for me.

Emil_Kos_0-1611646800559.png

You will have both approaches in the workflow:

 

Emil_Kos_1-1611646823441.png

 

 

If you could please mark both my post and @cgoodman3 as well. I have learned something interesting thanks to his post 🙂 

Emil_Kos
17 - Castor
17 - Castor

Hi @tjamal1,

 

Thank you and good luck with your projects!

nitin_l
7 - Meteor

How do we do this for Text values?

 

Sample Data

HouseDirections
House 1North
House 1West
House 1East
House 1South
House 2West
House 2East
House 2South
House 3North
House 3West

 

Output Data

For every House, all the missing Directions also needs to be included

 

HouseDirections
House 1North
House 1West
House 1East
House 1South
House 2North
House 2West
House 2East
House 2South
House 3North
House 3West
House 3East
House 3South
House 4North
House 4West
House 4East
House 4South
Labels
Top Solution Authors