In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Numerous Time Differences Per Row

KenAtHubbell
6 - Meteoroid

My macro logic is rusty.  Have a large source table with a primary key column and numerous stage-gate date fields requiring time deltas between them, in hours.  There is consistent logic to apply between every variation of [Start Date]/[End Date], logic much more complicated than what a DATEDIFF could manage.  For each input row, I'd like to reference the same 'macro' for each pair of Start/End dates; each time returning the hours between the dates.  

 

Is a Standard Macro the best approach?  The input data source is a pretty beefy workflow, and I'm envisioning the hours calculations to be the last part of the workflow.

 

Guidance?  (I do have the workflow in a macro that correctly returns what I'm looking for, based on my 1 row of test data on the macro input tool)

 

Modified to include attachments:

Input Data.xlsx - mock data source showing stage gates and desired columns to populate 

Calc State Get Hours Macro - sample of 1 record in Text Input that computes desired hours based on blackout dates

DIM Calendar.xlsx - mock calendar file showing which dates are blackout dates.

5 REPLIES 5
aatalai
15 - Aurora

@KenAtHubbell is it possible to see some of the data, as I'm struggle to see why date diff wouldn't work

KenAtHubbell
6 - Meteoroid

In short, the company maintains a time dimension that includes blackout dates.  The time calculation needs to exclude the blackout dates that may be between a starting and ending date.  I will put a mock workflow together later if this isn't enough information.  Thanks!!!

aatalai
15 - Aurora

@KenAtHubbell I would use this formula then

 

If !isempty([start]) and !isempty([end]) then DateTimeDiff([end],[start],"hours") else "N/A" endif

aatalai
15 - Aurora

or however you identify the blackout date 

KenAtHubbell
6 - Meteoroid

Modified original post to include attachments.  Thanks again!

Labels
Top Solution Authors