Forum Discussion
Aged Reporting using data from Sage 50 Accounts
The AUDIT_HEADER table has a DUE_DATE field. It also has PAID_FLAG and PAID_STATUS, but no Paid Date. Advice I've found elsewhere suggests that you can use the AUDIT_USAGE table to identify payments after the required date for Ageing.
Ok. I'm not familiar with the Sage50 reports that you're trying to reproduce so, if the following isn't what you're after, then you'll need to provide an example of the actual output you're trying to create.
You only need paid date if you want to do point-in-time reporting. As aged debt tends to be a snaphot metric, i.e. you only generally want to know what your position is now, then you can do this with the currently-available fields, something like this:
-1- In Power Query, create a new custom column to calculate the debt age ([debtAge]), something like the following:
if [PAID_FLAG] = 1 then null
else Number.From(Date.From(DateTime.LocalNow())) - Number.From(Date.From([DUE_DATE]))
-2- Create another custom column for grouping the debt age:
if [PAID_FLAG] = 1 then null
else if [debtAge] <= 0 then "Not Due"
else if [debtAge] <= 30 then "1-30"
else if [debtAge] <= 60 then "31-60"
else if [debtAge] <= 90 then "61-90"
else if [debtAge] <= 180 then "91-180"
else if [debtAge] <= 365 then "181-365"
else "> 1 year"
-3- Create a further column so you can sort these text values in your report:
if [PAID_FLAG] = 1 then 999
else if [debtAge] <= 0 then 1
else if [debtAge] <= 30 then 2
else if [debtAge] <= 60 then 3
else if [debtAge] <= 90 then 4
else if [debtAge] <= 180 then 5
else if [debtAge] <= 365 then 6
else 7
This should give you the basis for aged debt reporting.
Pete