Alteryx Designer Desktop Discussions

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

Calculating working days in a week

PNC97
8 - Asteroid

I trying to find the Hours working by the employee in a span of two weeks with the below conditions. I tried using the multirow formula by Datetimedifference and datetimeadd([IN], 6, 'days')  But didn't worked out for me.

 

Example:-

Emp 1 working for a week ie. from Aug 1st to 7th with daily 10 hrs of work and in between the Aug 1st to 7th emp Didn't worked on Aug 4th now the

  1. 1st output in new column should be sum of the hours worked in between Aug 1st to 7th by leaving Aug 4th.
  2. 2nd Output should be the hours between Aug 3rd last out to Aug 5th 1st In. 

Expecting a workflow solution!! 

 

 

2 REPLIES 2
john_watkins
11 - Bolide

You can do this a few ways.   I tend to think of this stuff in terms of tables-n-lookups.

 

1. Create a table using the "Generate Rows" tool that has one row per day of the year.  Add a column for week identifier (usually first day Sun/Mon of the week) or last day depending on how you work.      DAY   -->   WEEK IDENTIFIER

 

2. Create a trimmed field on start or end that makes sense and join it to the DAY field in your temp table.

 

3.  Do your DateTimeDiff on hours by day and then SUM,   GROUP BY WEEK

PNC97
8 - Asteroid

I think it will be helpful for 1st condition and If possible can help me with an workflow.

Labels