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

Alteryx Designer Desktop Discussions

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

Duplicate Row based on condition and add 6 months to [Date] column for new record

Tingggyy
5 - Atom

Hello everyone,

 

I just started learning Alteryx this month and have begun on my first use-case and I have been stumped by this for half a day. Intense googling didn't offer any solution, so here am I. 

 

So, I want to duplicate rows that has a "Flag = 1" and add 6 months to the existing [Date] value for the new record. 

I spent an inordinate amount of time to get 'Generate Rows' tool to work but the closest I got was for the date to get replicated till eternity (error) as I couldn't stop the loop.   The tutorial in the tool only had examples for creating a new column, which does not suit my purpose.

 

Feel like it should be a simple solution but for I just can't figure this out for the life of me. Grateful for any help!!

Thanks in advance!

 

Below a sample of my data. 

 

Input:

IDNameDateFlag
1172569Small Company01/07/20241
0760389Mid-sized Company01/04/2024 
1402646Medium Company01/08/2024 
1580926Average Company01/09/20241
1498636Enormous Company01/10/2024 
1332415Giant Company01/07/2024 
1285462Gigantic Company01/04/20241
1291444Humongous Company01/04/2024 

 

Desired Output - additions font formatted for easier sighting:

IDNameDateFlag
1172569Small Company01/07/20241
1172569Small Company01/01/20251
0760389Mid-sized Company01/04/2024 
1402646Medium Company01/08/2024 
1580926Average Company01/09/20241
1580926Average Company01/03/20251
1498636Enormous Company01/10/2024 
1332415Giant Company01/07/2024 
1285462Gigantic Company01/04/20241
1285462Gigantic Company01/10/20241
1291444Humongous Company01/04/2024 
2 REPLIES 2
binuacs
21 - Polaris

@Tingggyy One way of doing this

image.png

Tingggyy
5 - Atom

Thanks for the prompt reply @binuacs !!

 

I was trying very hard to get it to work only within the Generate Rows Tool but I will go with your suggestion. 

 

Thanks a million!!

Labels