Free Trial

Alteryx Designer Desktop Discussions

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

Generate rows to fill the date gap

zzhangs
5 - Atom

Hello, 

 

I am trying to get some help here on my project. 

 

the context: 

 

1. If the user activity_month_date > min_activity_month_date - it means the user did not use the app between the min_activity_month_date to activity_month_date

2. We need this user to have per month per row from Min to Max activity month date period (dynamically changing)  because we want to count the user in the denominator, so as long as this user's account still exists, we will count the user in the denominator for the given month. 

 

I have trouble adding the rows to fill the gap here, I appreciate any help! thank you! 

 

I have the input as below :

 

team_member_idhire_dateaccount_creation_dateactivity_month_dateMin_activity_month_dateMax_activity_month_date
A2018-06-012018-05-182023-09-012023-07-012024-11-01
A2018-06-012018-05-182023-10-012023-07-012024-11-01
A2018-06-012018-05-182023-11-012023-07-012024-11-01
A2018-06-012018-05-182023-12-012023-07-012024-11-01
A2018-06-012018-05-182024-01-012023-07-012024-11-01
A2018-06-012018-05-182024-02-012023-07-012024-11-01
A2018-06-012018-05-182024-03-012023-07-012024-11-01
A2018-06-012018-05-182024-04-012023-07-012024-11-01
A2018-06-012018-05-182024-05-012023-07-012024-11-01
A2018-06-012018-05-182024-06-012023-07-012024-11-01
A2018-06-012018-05-182024-07-012023-07-012024-11-01
A2018-06-012018-05-182024-08-012023-07-012024-11-01
A2018-06-012018-05-182024-09-012023-07-012024-11-01
A2018-06-012018-05-182024-10-012023-07-012024-11-01

 

Expected output 

 

team_member_idhire_dateaccount_creation_dateactivity_month_dateMin_activity_month_dateMax_activity_month_date
A2018-06-012018-05-182023-07-012023-07-012024-11-01
A2018-06-012018-05-182023-08-012023-07-012024-11-01
A2018-06-012018-05-182023-09-012023-07-012024-11-01
A2018-06-012018-05-182023-10-012023-07-012024-11-01
A2018-06-012018-05-182023-11-012023-07-012024-11-01
A2018-06-012018-05-182023-12-012023-07-012024-11-01
A2018-06-012018-05-182024-01-012023-07-012024-11-01
A2018-06-012018-05-182024-02-012023-07-012024-11-01
A2018-06-012018-05-182024-03-012023-07-012024-11-01
A2018-06-012018-05-182024-04-012023-07-012024-11-01
A2018-06-012018-05-182024-05-012023-07-012024-11-01
A2018-06-012018-05-182024-06-012023-07-012024-11-01
A2018-06-012018-05-182024-07-012023-07-012024-11-01
A2018-06-012018-05-182024-08-012023-07-012024-11-01
A2018-06-012018-05-182024-09-012023-07-012024-11-01
A2018-06-012018-05-182024-10-012023-07-012024-11-01
2 REPLIES 2
Luke_C
17 - Castor
17 - Castor

Hi @zzhangs 

 

Give this a shot, I grouped the data (minus your existing activity month field) and used the generate rows with a DateTimeAdd function to increment the months based on the min/max dates. 

image.png

flying008
15 - Aurora

Hi, @zzhangs 

 

Why are your field [activity_month_date] have 2 rows like '2024-01-01'  of input data?

 

录制_2024_12_18_11_49_48_88.gif

Labels
Top Solution Authors