DSO - Days Sales Outstanding

Calculates the number of days sales in the current period debtors using the exhaustion method.

Return Value

This routine calculates a single value representing the amount of days sales contained within the current period trade debtors figure. The DSO sub-routine included makes these assumptions:

  • Both Debtors and Sales are positive figures.

  • The parameters supplied are fully defined points of view (for example, Account/C1/C2/C3/C4/ICP) because the routine uses the HS.GETCELL function.

  • The routine calculates the days going back as far as possible in time. However, it will stop if the periodic sales value for any period is a negative or zero value.

Syntax

CALL DSO (strDSO,strDEBTOR,strSALES,strDIP)

Table 12-9 Syntax of DSO Function

Parameter Valid Values

strDSO

Fully defined account with custom and intercompany dimensions. This account is the destination for the calculation.

strDEBTOR

Fully defined account with custom and intercompany dimensions. This account is the source for the current period trade debtors.

strSALES

Fully defined account with custom and intercompany dimensions. This account is the source for the sales.

Specifically exclude references to frequency.

strDIP

Fully defined account with custom and intercompany dimensions. This account is the source for the number of days in the period.

This is assumed to be in the [None] entity.

Detailed Description

The routine takes the values in the Debtors account (parameter 2) and Sales account (parameter 3) for the current period and compares them. If either are zero or negative, the calculation stops. For each successive period where the debtors value exceeds that of the cumulative sales (working backwards from the current period), the routine adds the number of days for that period as specified in the days in the Period account (parameter 4) to a running total.

When all the Debtors values have been exhausted in this way, the final period’s days are calculated as a proportion of the unexpired debtors against the periodic sales value.

Finally, the routine posts the running total to the destination account (parameter 1).

Example

The example calculates the total days outstanding for the months shown.

Table 12-10 Example of DSO Function

Month Debtors Period Sales Days in Month Formula for DSO Total DSO

September

12,000

2,500

30

100%

30

August

N/A

1,750

31

100%

31

July

N/A

2,250

31

100%

31

June

N/A

2,500

30

100%

30

May

N/A

2,000

31

100%

31

April

N/A

2,250

30

2000/2250

26.7

Total

N/A

N/A

N/A

N/A

179.7

Sample Script

' Use within the calculation section:
' 1. Standard use
CALL DSO("A#DSO","A#TradeDebtors.C1#AllAges.C2#[None].I#[ICP Top","A#TotalSales.C1#[None].C2#AllProducts.I#[ICP Top]", "A#DIP")
' 2. Use with a common custom dimension
set vPRODUCT = ARRAY("C2#PRODUCT1","C2#PRODUCT2", ….. ,"C2#PRODUCTn")
FOR EACH iITEM IN vPRODUCT
CALL DSO("" A#DSO.""&iITEM,"" A#TradeDebtors.C1#AllAges.I#[ICP Top].""&iITEM,"" A#TotalSales.C1#[None].I#[ICP Top]."" &iITEM,"" A#DIP"")
NEXT
' Actual script of Sub-routine
SUB DSO(strDSO,strDEBTOR,strSALES,strDIP)
DIM vTEST
DIM vDSO
DIM vCOUNT
DIM vXS_1
DIM vXS
HS.CLEAR(strDSO)
vTEST = HS.GETCELL(strDEBTOR) * HS.GETCELL(strSALES&"".W#Periodic"") * HS.GETCELL(strDIP&"".E#[None]"")
' checks if any of the parameters are zero (uses principle of X * 0 = 0)
IF vTEST = 0 THEN
EXIT SUB
ELSE
vDSO = 0
vCOUNT = 0
vXS_1 = HS.GETCELL(strDEBTOR)
vXS = vXS_1 - HS.GETCELL(strSALES&"".W#Periodic"")
' ensures that periodic sales are not negative or zero
WHILE vXS > 0 AND vXS_1 > vXS
vDSO = vDSO + HS.GETCELL(strDIP&"".E#[None].P#CUR-"" &vCOUNT)
vCOUNT = vCOUNT + 1
vXS_1 = vXS
vXS = vXS - HS.GETCELL(strSALES&"".W#Periodic.P#CUR-"" &vCOUNT)
WEND
IF vXS = vXS_1 THEN
vCOUNT = vCOUNT - 1
END IF
vDSO = vDSO + (vXS_1 / HS.GETCELL(strSALES&"".W#Periodic.P#CUR-"" &vCOUNT)*HS.GETCELL(strDIP&"".E#[None].P#CUR-"" &vCOUNT))
IF vDSO < 0 THEN
vDSO = 0
END IF
END IF
HS.EXP strDSO &"="& vDSO
END SUB