Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Generate Rows tool for adding one week

Alayna
8 - Asteroid

Hi all,

 

I am trying to figure out how to use generate rows to add different weeks. Basically, I have a list of FLSA end dates for each employee that go in sequential order every 7 days (2021-04-18, 2021-04-25, etc.). And I'm pulling out dates that do not have that next week in order (2021-04-18, 2021-05-02). I want to use generate rows to add that 2021-04-25 back under the 2021-04-18, so that the below 8 rows turn into 16 total, two sequential weeks for each of the employees.

 

Just not sure how to set up the tool because I get the "Value did not change after the Loop Expression" error.

 

flsa dates.PNG

 

 

generate rows.PNG

 

8 REPLIES 8
AngelosPachis
16 - Nebula

Hi @Alayna ,

 

Although it's not clear to me what your desired output looks like, you are getting that error message because your condition and loop expressions are malformed.

 

Your condition expressions should be something like : 

 

[RowCount]<[Performance Period End Date]

 

and you loo expression should be:

todate(datetimeadd([Rowcount],7,"days"))

for the value to change after the loop expression.

 

It would help if you also share a desired output based on the 8 records you have included as a sample and some mock data that we can work with, if the above changes don't answer your question.

 

Cheers,

Angelos

Alayna
8 - Asteroid

Hi @AngelosPachis thank you that's very close to what I want, but it adds too many weeks. I've attached a sample workbook of what I'm looking for, Which is just one other week added for each employee

atcodedog05
22 - Nova
22 - Nova

Hi @Alayna 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1629219986127.png

 

1. Using gen row to gen 2 rows for each row.

2. Using multi-row formula for row 2 changing start date by referencing row 1 end date+1.

3. Using formula calculate end date for row 2.

 

Hope this helps : )

Alayna
8 - Asteroid

@atcodedog05 Yes that helps. Thank you so much!

AngelosPachis
16 - Nebula

Hi @Alayna ,

 

Thank you for sending over that excel spreadsheet. Since you have already isolated those records that don't have the next week in order, what I would do is use a generate rows tool to create a second row per record and then via a formula tool, add 7 days to the FLSA start and end dates if the row count is equal to 2.

 

AngelosPachis_0-1629220423844.png

 

Hope that helps,

Angelos

 

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @Alayna 

Cheers and have a nice day!

atcodedog05
22 - Nova
22 - Nova

Interesting approach @AngelosPachis directly calculating +7 for the second row 🙂. Why didnt i think about that 😅.

AngelosPachis
16 - Nebula

I think because you are in a rush @atcodedog05, but in any case there are more than one ways to reach the same result in Alteryx 🙂

Labels