Survey banner
Switching to Dataiku - a new area to help users who are transitioning from other tools and diving into Dataiku! CHECK IT OUT

Date Difference

Level 1
Date Difference


I want to calculate Date difference between 2 columns by excluding the weekends. I was wondering is there any formula by which I can calculate the same in the Visual Recipe. I however managed to solve this using Python Code recipe but I want to do the same in Visual Recipe. 


0 Kudos
1 Reply

If you have Python code able to perform the computation, then you can use it in a Prepare recipe on a row-by-row basis. You can also probably replicate your computations with the Extract date component processor (to get the dayOfWeek of the start and end dates), the Compute difference processor (to compute the number of days between the 2 dates) and a bit of Formula step.

For a purely visual approach, you'll need to have a dataset of the dates of the non-weekend days (possibly the non-holiday dates too) covering the time range present in your dataset, use a join recipe from you dataset on the non-weekend days to retrieve the days where start <= non-weekend-day <= end, then a Grouping recipe to count the number of non-empty non-weekend-day joined.