Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.
Free Trial

Alteryx Designer Desktop Discussions

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

Calculate number of days, day of week

kapoorp
7 - Meteor

Hi,

 

I have the data which has information as mentioned below. I need to find out the total days of travel for a person and the day of travel - Monday =1, Tuesday=2 ... Sunday=7 as given in Output. Is any help possible?

i/p:

NameDateAmt
A4/10/2019190
A4/11/2019200
A6/15/2019195
A6/16/2019200
B7/2/2019250
B7/3/2019295
C5/15/50192000

 

O/P:

NameDays Of TripAmt
A2390
A2395
A1200
B2445
C12000

 

NameDays of Travel
A1,2
A3,4
A4
B5,6
C1

 

(1,2 means the travel ws on Monday and Tuesday. 3,4 means travel was on Wednesday & Thursday etc).

6 REPLIES 6
JosephSerpis
17 - Castor
17 - Castor

Hi @kapoorp I mocked a workflow that I think produces the output you describe. I had to change the third table in order to make the workflow work in order to get the summary of the amt column to match your output table based on the mock date from your input table. Let me know what you think?

kapoorp
7 - Meteor

Hi,

 

You have taken the output table as one of the inputs.  There is only 1 input which is:

 

clipboard_image_0.png 

 

And in output, the requirement is to have count days travelled and the day of the week on which the user travelled.

PhilipMannering
16 - Nebula
16 - Nebula

Does this get what you need?

 

I assume consecutive days that have the same name are considered as a single trip.

 

P

kapoorp
7 - Meteor

Hi,

 

This fails when there are 3 or more consecutive days

NameDateAmt
A2019-04-10200
A2019-04-11200
A2019-05-16200
A2019-05-17200
A2019-05-18200

 

OUTPUT SHOULD BE:

 

NameConsecutive DaysTot Amt
A2400
A3600

 

output with your workflow:

NameConsecutive DaysTot Amt
A2400
A2400
A1200

 

PhilipMannering
16 - Nebula
16 - Nebula

I just tried changing so there's three consecutive days in a row and seems to work fine.

 

Take a look at the attached (thought it's pretty much the same).

 

If you're still having issues then post the workflow where this is failing and I'm sure we can fix it.

 

P

kapoorp
7 - Meteor

Thanks.

Labels
Top Solution Authors