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

generate the row based on condition

alt_tush
9 - Comet

Hi All,

 

I have below data where my Report_Date data type is Date.

 

UserIDCostCenterReport_Date
100A10015-01-2021
100B10019-01-2021
100C10031-01-2021
200A20025-01-2021
200B20031-01-2021
300A30001-02-2021
300B30011-02-2021
300C30021-02-2021
300D30026-02-2021

 

My expected output is to generate the multiple rows by incrementing the report by 1 on group level of user id and cost center.

 

If in my first row Userid is 100 , cost center is A100 and report date 15-01-2021 then my new row generation would be 16-01-2021, 17-01-2021 and so on till 18-01-2021 i.e. next cost center and report date change for same user id. In above case report date is changed on 19-01-2021. So next incremental entry should be based on new cost center i.e. B100 and Report Date 19-01-2021 till next report date.

 

It means my output would be as below

 

UserIDCostCenterReport_Date
100A10015-01-2021
100A10016-01-2021
100A10017-01-2021
100A10018-01-2021
100B10019-01-2021
100B10020-01-2021
100B10021-01-2021
100B10022-01-2021
100B10023-01-2021
100B10024-01-2021
100B10025-01-2021
100B10026-01-2021
100B10027-01-2021
100B10028-01-2021
100B10029-01-2021
100B10030-01-2021
100C10031-01-2021
200A20025-01-2021
200A20026-01-2021
200A20027-01-2021
200A20028-01-2021
200A20029-01-2021
200A20030-01-2021
200B20031-01-2021
300A30001-02-2021
300A30002-02-2021
300A30003-02-2021
300A30004-02-2021
300A30005-02-2021
300A30006-02-2021
300A30007-02-2021
300A30008-02-2021
300A30009-02-2021
300A30010-02-2021
300B30011-02-2021
300B30012-02-2021
300B30013-02-2021
300B30014-02-2021
300B30015-02-2021
300B30016-02-2021
300B30017-02-2021
300B30018-02-2021
300B30019-02-2021
300B30020-02-2021
300C30021-02-2021
300C30022-02-2021
300C30023-02-2021
300C30024-02-2021
300C30025-02-2021
300D30026-02-2021

 

Thank you in advance.

3 REPLIES 3
Christina_H
14 - Magnetar

Here you go

Christina_H_1-1637158981030.png

 

 

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @alt_tush,

 

I've taken a slightly different method to @Christina_H to avoid the union:

 

(1) Convert date into correct date data type

(2) Calculate the end date to generate records to

(3) If we've got no end date, set end date as report date

(4) Generate rows between the dates

 

JonathanSherman_0-1637160790883.png

 

I've attached my workflow for you to download if needed!

 

Kind regards,

Jonathan

 

alt_tush
9 - Comet

Hi Cristina H,

 

Thank you so much for your help. Its resolved my blocking issue. That exactly i wanted, 

Thanks again 🙂

Labels