In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Generate rows based on conditions

BudzyW
6 - Meteoroid

Hi all

 

I'm using the generate rows tool for the first time and I'm stuck at one point in the process. I need to generate multiple rows from a start date in the inputs file (example 2024/03/15) until the maturity date (example 2027/06/30) based on 6 months interval with a caveat that if the maturity date does not coincide with the last six months interval date then a separate row should be generated for the maturity date as well. So I'm expecting separate line items to be created for 2024/03/15, 2024/09/15, 2025/03/15, 2025/09/15, 2026/03/15, 2026/09/15, 2027/03/15 and 2027/06/30 in the work flow.

 

I've currently used the condition expression in the generate rows tool saying [Next Date] <= [Maturity Date] with the loop expression DateTimeAdd([Next Date], 6, "months"). However, I can't seem to figure out a way to add the maturity date record as a separate row.

 

Would be extremely thankful if you can suggest a way ahead with this requirement.

 

Thanks in advance

4 REPLIES 4
binu_acs
21 - Polaris

@BudzyW You need to convert your date in to ISO format (YYYY-MM-DD) to work the DateTime functions, before generate row tool

image.png

BudzyW
6 - Meteoroid

Thanks for the reply. I was able to generate the same 7 rows but I failed to generate the 8th row where the date would be 2027-06-30

binu_acs
21 - Polaris

that is because the month interval is 6 months, the last should ne 2027-03-15 then if you add 6 months it will be 2027-09-15, do you want to add 2027-06-30 then use a union tool and connect the generate records output and also from the multi-field output

image.png

BudzyW
6 - Meteoroid

Thanks, this solved my issue.

Labels
Top Solution Authors