We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Calculate Days from Today to a Projected Open and Projected Close Dates

hellyars
13 - Pulsar

DateDif question....

 

I want to calculate how many days are left between

 

  1. Today() and a projected OpenDate
  2. Today() and a projected Close Date
  3. If Today() is past the Projected Open Date I want to return a 0.  Null will not work as there are a large number of records for which there are no dates.

 

 

Sample Dates...

 

RecordID

OpenClose
12021-10-012021-11-30
22021-08-122021-09-15
32021-12-012022-01-31
4  
52022-02-012022-06-15
3 REPLIES 3
mbarone
16 - Nebula
16 - Nebula

"0" is not a valid date format.  So you cannot have "0" in a date field.  Maybe pick a ridiculous date like 12/31/4712.  That will serve as your "0".

hellyars
13 - Pulsar

@mbarone  My bad.  But, you still get the point.  Then any value with a negative date or something that allows me to distinguish a record that is past a due date from those that have no dates.

mbarone
16 - Nebula
16 - Nebula

Yes, or stick with the nulls and add a field called "past_due" with values of 1 or 0, where 1 would mean a negative date diff.  

Labels
Top Solution Authors