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.
Solved! Go to Solution.
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
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
Hi @Alayna
Here is how you can do it.
Workflow:
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 : )
@atcodedog05 Yes that helps. Thank you so much!
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.
Hope that helps,
Angelos
Happy to help : ) @Alayna
Cheers and have a nice day!
Interesting approach @AngelosPachis directly calculating +7 for the second row 🙂. Why didnt i think about that 😅.
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 🙂