# How the identification score is calculated for XML invoices

Identifiers that are specified in each XML invoice profile are compared to XML invoices as the invoices enter the system. A hit-point value of 1 is applied to each identifier found in an incoming XML invoice that matches one in the XML invoice profiles in the system.

• So when identifiers are tested against the current invoice when adding identifiers, each identifier either has a value of 1 (found in the invoice) or 0 (not found in the invoice) in the Matching Results dialog.
• When identifiers are tested against all XML invoices in the system, the following information applies:

## Calculating the identification score for an invoice to individual XML invoice profiles

The identification score for an incoming XML invoice is calculated separately for each XML invoice profile by dividing the number of matched identifiers by the total number of identifiers that are specified in the profile. The resulting identification score for an invoice in connection with an XML invoice profile is a number between 0 - 1. The higher the value in connection with a profile, the higher the probability that the invoice belongs to it.

The invoice is finally connected to the profile with the highest corresponding identification score.

## Example

A system has three XML invoice profiles with the following identifiers specified:

 Profile Root identifiers Namespace identifiers Structure identifiers Max score Profile 1 2 0 2 2+0+2=4 Profile 2 1 1 3 2+0+3=5 Profile 3 2 0 6 2+0+6=8

An XML invoice enters the system and is matched against the profiles in the system with these results:

• Profile 1 - the incoming invoice matches one root identifier and two structure identifiers.
• Profile 2 - the incoming invoice matches one root identifier, one namespace identifier, and one structure identifier.
• Profile 3 - the incoming invoice matches one root identifier and five structure identifiers.

The identification score for this invoice for each profile is consequently:

 Profile Hit points for invoice Total identifiers specified in profile Calculation ID score Profile 1 1(R)+2(S) = 3 4 3/4 0.75 Profile 2 1(R)+1(N)+1(S)=3 5 3/5 0.6 Profile 3 1(R)+5(S)=6 8 6/8 0.75

In this scenario, even though the identification score is identical for profiles 1 & 3, the invoice would be associated with Profile 3 since the total number of identifiers that are specified for Profile 3 is higher than the total number of identifiers for Profile 1.

Note If the identification score for an invoice is 0 (zero) for all XML invoice profiles in the system, the invoice is automatically associated with the General XML profile.