Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

How to count overdues day by day

Skyrone
7 - Meteor

Hello everyone,

 

I'm trying to count the number of invoices with payment delays, day by day. 

I'm trying to get them on a full calendar to say "at this point, I know I have X late invoices, with a total amount of Y", but I cannot find how to perform this.

I looked up for Advanced join with conditions in the join but I think I'm on the wrong track.

 

For example, let's say I have these 5 invoices :

Table 1

Invoice IDAmountDocument DatePayment DatePayment delay
11001/01/201904/03/201963
22002/01/201905/03/201963
32003/01/201906/03/201963
45003/01/201905/03/201962
510005/01/201908/03/201963

 

A payment is considered delayed if the payment delay is over 60 days.

That means the result I'm trying to get is as follows :

Table 2

Calendar DateNumber of late invoicesAmount
01/03/201900
02/03/201900
03/03/2019110
04/03/2019230
05/03/2019390
06/03/20192120
07/03/20191100
08/03/20191100

 

From my data, I know that, for example, on March 6th, invoices 3 & 5 are still. That means I have 2 invoices late with 120$ in total amount.

 

Does anyone has any idea of how to get from Table 1 to Table 2 ?

3 REPLIES 3
carlosteixeira
15 - Aurora
15 - Aurora

Hi @Skyrone 

If i understand you need this...

 

carlosteixeira2005_0-1577992306974.png

 

Best regards

Carlos A Teixeira
danilang
19 - Altair
19 - Altair

Hi @Skyrone 

 

Here's one way to do it.

 

w.png

 

After your invoice list box, generate a list of overdue dates for each invoice.  Sum up the total due on each overdue date as well as the number of invoices due.  Join this to a calendar of the days in question.  Union to fill in the missing dates and clean up, giving you

 

r.png

 

BTW.  I thinkk you may have made a mistake in your original post.  You showed $120 due on the 6th, but you had 2 invoices paid on the 5th so the actual due was only $20

 

You also had Interesting use of the TS Filler macro to generate a list of dates.  It works but the Generate rows tool is faster. 

 

Dan

Skyrone
7 - Meteor

Hi Carlos, Danilang,

 

Thank you both for your quick answers.

 

@danilang I just learned a new transformation, "Generate rows" that I never used before ! That fits perfectly what I need.

 

I initialized CalculationDate with formula "DateTimeAdd([Document Date],61,"days")" instead of 62, because I consider that, for example, if payment delay is 63, that's 3 days late. 

So yes, the result I posted is false because it was more supposed to be this one :

Skyrone_0-1578042355398.png

 

Have a great day,

Alex

 

 

Labels