community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Calculate number of days, day of week

Highlighted
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).

Alteryx Certified Partner
Alteryx Certified Partner

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?

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.

Alteryx Certified Partner

Does this get what you need?

 

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

 

P

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

 

Alteryx Certified Partner

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

Meteor

Thanks.

Labels