Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

creating a binary indicator based on two date field columns, with conditions

jbuszin
8 - Asteroid

I have two different date fields that represent ID 1 talking to two different people. I'm interested in creating a 0/1 indicator of if more than 30 days pass between calls to person A, how many calls were made to person B in the 30 days prior to the next call to person A. For example, there are 128 days between 4/23 and 8/29. So in that case, I want to know the total number of times ID 1 talked to person B, but only the calls with person B that happened within 30 days of 8/29. So although 13 total calls happened only 11 of them should count. Imagine a third column on the right where the first row is null, the second is 0, the third is 0, but the fourth (and subsequent rows until the 8/29 row for talked to person A) is 1.

 

And because the next call to Person A happened just 12 days later, I would count the person B call as a 1 in this third column we're creating. Finally, a call to person A doesn't happen again for 85 days, until 12/4. So I'm wanting to put a "1" next to each of the calls to person B that happened between 11/4-12/4 only. The calls from 9/20-11/3 don't count and get a 0. Hope that makes sense.

 

Talked to Person ATalked to Person B
4/23/2018[Null]
[Null]6/13/2018
[Null]7/18/2018
[Null]8/6/2018
[Null]8/8/2018
[Null]8/9/2018
[Null]8/10/2018
[Null]8/13/2018
[Null]8/21/2018
[Null]8/23/2018
[Null]8/24/2018
[Null]8/27/2018
[Null]8/28/2018
[Null]8/29/2018
8/29/2018[Null]
[Null]9/10/2018
9/10/2018[Null]
[Null]9/20/2018
[Null]9/21/2018
[Null]9/24/2018
[Null]10/3/2018
[Null]10/8/2018
[Null]10/10/2018
[Null]10/12/2018
[Null]10/18/2018
[Null]10/23/2018
[Null]10/24/2018
[Null]10/25/2018
[Null]10/26/2018
[Null]10/28/2018
[Null]10/29/2018
[Null]11/6/2018
[Null]11/7/2018
[Null]11/8/2018
[Null]11/9/2018
[Null]11/19/2018
[Null]11/20/2018
[Null]11/21/2018
[Null]11/28/2018
[Null]11/29/2018
[Null]11/30/2018
[Null]12/3/2018
12/4/2018[Null]
2 REPLIES 2
fmvizcaino
17 - Castor
17 - Castor

Hi @jbuszin ,

 

Took me a while to understand the rules but I think I nailed it!!

Example attached.

 

Best,

Fernando Vizcaino

jbuszin
8 - Asteroid

you absolutely nailed it-thanks so much! I wasn't figuring out that last formula correctly

Labels