Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Combining a IF and a tenure calc

bcastle88
6 - Meteoroid

Hey guys,

I'm still fairly new to Alteryx but have caught on pretty quickly with some basic data prep. I now need to combine 2 existing calculations. I have one (below) that calcs tenure for all of my clients

 

IF isnull([END_DATE])
THEN DateTimeDiff(DateTimeToday(),[START_DATE],"months")
ELSE DateTimeDiff([END_DATE],[START_DATE],"months")
ENDIF

 

I now need to run this same calc but on a subset of clients. So i don't dilute my tenure I need to determine the tenure for my "Termed" clients. To determine my termed clients I use the below calc to determine my true "Termed" clients

 

IF [TERMINATION_REASON] = "No Start" THEN " "
ELSEIF [TERMINATION_REASON] = NULL() THEN " "
ELSE 1
ENDIF

 

I need to calculate the Tenure of my clients that meet the "1" criteria in the above calculation.

 

FYI, This work flow is replacing a manuel effort that ultimatily feeds into a preexisting Tableau dashboard that I didn't create so I'm stuck using the same logic as was used intially.

 

Any help would be greatly appreciated.

BC

1 REPLY 1
MarqueeCrew
20 - Arcturus
20 - Arcturus

@bcastle88,

 

I think that this is what you're after:

 

IF 
[TERMINATION_REASON] = "No Start"  THEN " "      ELSEIF [TERMINATION_REASON] = NULL()       THEN " "      ELSEIF 
isnull([END_DATE])                                   THEN 
          DateTimeDiff(DateTimeToday(),[START_DATE],"months")
ELSE DateTimeDiff([END_DATE],[START_DATE],"months")
ENDIF

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Labels
Top Solution Authors