Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Iterate and insert new rows

AmruthaPydeti
8 - Asteroid

Hi There,

I am new to Alteryx. I have a scenario where I have to extract last month Data and show the same data for the current month and for the next 6 months changing couple of fields. I am pretty comfortable in SQL Server where I will write a  loop to insert by selecting data from last month and change the date in select columns. 

 

Example:

FirstDayMonth  ID       A/B         Count

7/1/2018             1        B              170

8/1/2018            1       B              165

9/1/2018            1       A               165

10/1/2018          1       A               165

11/1/2018          1       A               165

12/1/2018          1       A              165

1/1/2019            1       A              165

2/1/2019            1       A               165

3/1/2019             1       A              165

 

Current Date is 9/20/2018. So I have to pull 8/1/2018 and change B to A and show same count for 9/1/2018 till 3/1/2018. Please suggest

3 REPLIES 3
danilang
19 - Altair
19 - Altair

Hi

 

This will do what you're looking for.

 

Assuming your input is something like this with previous months data

Input.png

 

This workflow will generate new dates for the current and next 6 months, fill in the proper values and append the data to the input rows

 

Solution.png

It actually gets the last valid date from the input data, so if the previous month's data is missing, it will use the one before.

 

Dan

 

 

AmruthaPydeti
8 - Asteroid

Thank you Dan. That worked!!

danilang
19 - Altair
19 - Altair

If you're happy with it, please consider marking it as a solution

 

Thanks

 

Dan

Labels