When an audit test is a query, the workpaper is the code. The sample of 25 invoices with a tick-marked spreadsheet has been replaced, in many functions, by a script that joins three extracts, applies a dozen rules and produces a list of 412 exceptions, and the documentation has not caught up: the workpaper is a screenshot of the result, the extract is a file on someone’s laptop named “AP_final_v3_USE_THIS.xlsx,” the query lives in a tool that was upgraded since, and the auditor who wrote it has left. None of this survives the question a reviewer, an external auditor or a regulator will ask: show me how you got this number, and show me that it is complete. Analytics evidence is held to the same standard as any other audit evidence (reliable, relevant, sufficient, and documented so that an informed reader can understand what was done and why), and meeting that standard for code requires practices that paper workpapers never needed.
This guide sets the standard: why analytics evidence fails review, the evidence chain from source to conclusion, what to document at each stage, the reproducibility test, tool-specific practices for SQL, Power Query, Python and the ACL-era tools, information produced by the entity, data handling and retention, review of code, a worked example from MidState Beverage, the analytics workpaper template, and the failures that recur. It extends the workpapers and workpaper example guides to the case where the evidence is a dataset and a script, and pairs with the SQL for auditors guide, which teaches the queries this guide documents.
In this guide
- Why analytics evidence fails review
- The evidence chain from source to conclusion
- What to document at each stage
- Completeness: record counts, control totals and reconciliation
- Versioning, environment and reproducibility
- Tool-specific practices
- Information produced by the entity
- Data handling, privacy and retention
- Second-person review of analytics
- When others rely on the analytic
- Results and interpretation
- A worked example: MidState Beverage’s duplicate payment analytic
- The analytics workpaper template
- Failures that recur
- Questions about documenting analytics
- Related guides
Why analytics evidence fails review
Analytics evidence fails for reasons that paper evidence rarely did. The population is unproven: the extract was taken from a report or a download whose completeness nobody tested, so the 412 exceptions are exceptions in whatever the extract contained. The logic is invisible: a filter applied in a spreadsheet, a join type chosen by default, a threshold typed into a cell, none recorded, so the result cannot be explained or re-performed. The version is lost: the query was edited after the result was produced, the tool was upgraded, the extract was refreshed, and the workpaper’s numbers no longer match anything that can be regenerated. The interpretation is missing: 412 exceptions, but which are true exceptions, which are false positives from a rule that over-fires, which were followed up, and what the auditor concluded. The data has gone: the extract was deleted for privacy or lost with the laptop, so nothing can be re-run. External auditors who want to rely on internal audit’s analytics, and examiners reviewing an institution’s issue validations, ask for exactly these things, and the Global Internal Audit Standards’ documentation requirement (sufficient to enable an experienced auditor with no previous connection to the engagement to understand the work and support the conclusions) applies to a script as much as to a memo. The standard is reproducibility: another auditor, with the workpaper and access to the same source, should be able to regenerate the result and reach the same conclusion.
The evidence chain from source to conclusion
Every analytic follows the same chain, and the documentation follows it stage by stage. The source: the system of record (or the report, or the file) the data came from, and why it is the right source for the assertion being tested. The extraction: how the data left the source (a direct query, a standard report, a vendor export, a file from a control owner), with the parameters (date range, entity, status filters), the timestamp, who ran it and under what access. The completeness check: the reconciliation that proves the extract is the population (record counts and control totals against an independent figure). The transformation: every step that changed the data (cleansing, joins, derived fields, filters, rules), in a form that can be read and re-run. The result: the output dataset, with its own counts and totals, preserved as produced. The interpretation: what the result means, how exceptions were triaged, what was followed up with what outcome, and the conclusion. Each stage has an artifact (a query, a log, a reconciliation, a script, a file, a memo), and the workpaper is the set of artifacts with a cover that explains how they connect. Breaking the chain at any stage breaks the evidence: a perfect script on an incomplete extract, or a complete extract transformed by an undocumented spreadsheet, produces a number no one can defend.
What to document at each stage
| Stage | Document | Artifact | Common gap |
|---|---|---|---|
| Source | System and table or report name; owner; why this source for this assertion; known limitations | Data lineage note; data dictionary for fields used | “The AP data” with no system or table |
| Extraction | Method (query, report, export); exact parameters; date and time run; who ran it; access used; raw record count and control total | The extraction query or report parameters; extraction log; the raw file preserved read-only | Parameters not recorded; refreshed extract overwrote the original |
| Completeness | Reconciliation of extract counts and totals to an independent figure (ledger, system total, prior report); explanation of differences | Reconciliation worksheet with sources cited | No reconciliation; or reconciled to the same report the extract came from |
| Transformation | Every cleansing, join, derivation, filter and rule, with the business reason and the thresholds; join types and key fields; handling of duplicates, nulls and dates | The script or query with comments; or the step list exported from the tool | Logic in spreadsheet formulas and manual edits; default join types unexamined |
| Result | Output counts and totals; the output file preserved as produced; the reconciliation of output back to input (records in equals records out plus records excluded, with reasons) | Result file; input-output reconciliation | Screenshot of the top of a table |
| Interpretation | Triage rules for exceptions; false positive analysis; follow-up performed per exception or per category; conclusion against the objective; limitations | Exception log with dispositions; conclusion memo | Exception count reported as if every exception were a finding |
| Versioning and environment | Script version identifier; tool and version; packages or add-ins; the date the analysis was frozen | Repository commit or saved version; environment note | Script edited after the result; tool upgraded; result irreproducible |
| Review | Second-person review of the logic and a re-run or recalculation of a portion | Review notes and sign-off | Reviewer signs the memo without reading the code |
Completeness: record counts, control totals and reconciliation
Completeness is the stage most often skipped and the one that most often invalidates the work. The extract must be shown to be the population the objective requires, and the proof is a reconciliation to a figure that did not come from the same extraction: the general ledger balance for the period against the sum of the transaction extract; the system’s own record count (a count query run separately, or a screen showing the total) against the rows received; a prior period’s audited total against the extract’s prior-period subset; a hash total or sum of a numeric field that would change if rows were lost. Differences are explained, not tolerated: timing (the ledger includes a posting the extract’s cutoff excluded), scope (intercompany rows excluded by a filter, stated), or an actual gap (rows missing, which means the extract is re-taken). The reconciliation is documented with both sources named and the arithmetic shown, and it is repeated at the output stage: the rows going into the rule set equal the rows coming out as exceptions plus the rows passing plus any rows excluded by design. An auditor who can show counts and totals at both ends of the chain has evidence; one who cannot has a list. The IPE testing guide covers the related problem of reports produced by the entity, and the account reconciliations guide the discipline this borrows.
A practical habit makes completeness routine: the extraction script prints its own counts and totals as its last step, the reconciliation worksheet is the first tab of every analytics workpaper, and no transformation begins until the reconciliation is signed. Functions that adopt the habit stop losing arguments about data; the ones that do not spend the closing meeting defending a number they cannot tie to anything.
Versioning, environment and reproducibility
Code changes, and the workpaper must freeze the version that produced the result. The practices, in order of robustness: a version control repository (git, hosted in the organization’s tooling) with the script committed and the commit identifier recorded in the workpaper; a saved and locked copy of the query or workflow in the analytics tool with a version label; at minimum, a dated read-only copy of the script stored with the workpaper. The environment matters as much: the tool and its version (database engine, Power Query within a named Excel or Power BI build, Python with its interpreter and package versions captured in a requirements file, the ACL-era tool and its release), because a function or a default can change between versions (date parsing and rounding are the classic cases) and the result with it. Reproducibility is the test of all of this: a second auditor, given the workpaper, the frozen script, the preserved extract and the environment note, should regenerate the result exactly, and a good function has that re-run performed as part of review for any analytic that supports a significant finding. Where the source data cannot be preserved (privacy, size), the extract’s counts, totals and a sample of rows are preserved, the extraction query is frozen, and the workpaper states that re-running against the live source will return a different population; that is a limitation, documented, rather than a defect. The IT change management guide’s logic, applied to the auditor’s own code, is the standard: no undocumented change to a script that produced evidence.
Tool-specific practices
| Tool | What to preserve | Practices | Pitfalls |
|---|---|---|---|
| SQL (direct database or warehouse queries) | The query text with comments; parameters; the database and schema; execution timestamp; row counts returned | Save queries as files under version control; comment every filter and join with its reason; use explicit join types; capture counts with a separate count query; avoid SELECT * in evidence queries (name the fields) | Queries run interactively and never saved; implicit joins dropping rows; time zone and date boundary errors |
| Power Query (Excel, Power BI) | The applied steps (exportable as M code via the advanced editor); source connection details; the refreshed data snapshot | Name steps descriptively; export the M code to the workpaper; disable automatic refresh on the evidence copy; record the Excel or Power BI version | Steps renamed “Changed Type” with no meaning; refresh overwrites the evidence; locale-dependent type conversion |
| Python (pandas and the like) and R | The script or notebook; the environment (requirements file or lock file); input file hashes; output files | Scripts in a repository; a run log printing counts at each stage; notebooks executed top to bottom and saved with outputs; seed any randomness; no manual edits to outputs | Notebooks run out of order; package version drift; outputs edited by hand |
| ACL, IDEA and similar audit analytics tools | Scripts or project logs; the log the tool generates; table definitions; result tables | Use the tool’s scripting and log features rather than menu-driven steps; export logs to the workpaper; preserve result tables | Menu-driven work with no script; project files not archived |
| Alteryx and workflow tools | The workflow file; configuration of each tool; input and output record counts (the tool’s own) | Annotate workflows; save with a version; export the workflow image and the configuration | Workflows updated in place; macros with hidden logic |
| Spreadsheets (as a last step only) | The file with formulas intact; a formula map; no hard-coded overrides | Use spreadsheets for presentation of results, not transformation; if a transformation is unavoidable, document every formula and lock the file | Manual deletions and pasted values; filters applied and forgotten |
The Alteryx versus Power Query, IDEA and ACL reviews describe the tools; the documentation standard is the same for all of them, and the function’s methodology should say so in one page that every analyst reads.
Information produced by the entity
Much analytics data arrives as information produced by the entity: a report the control owner ran, an export from a vendor system, a file prepared by finance. The IPE testing guide covers the evaluation (is the report complete and accurate, were its parameters appropriate, is its logic sound), and for analytics the documentation records that evaluation as part of the source and extraction stages: who produced the file, from what system, with what parameters, when, and what the auditor did to test it (re-performed the report, reconciled it to the system, tested the logic of a custom report). Where possible the auditor extracts directly rather than receiving a file, which converts the IPE question into an extraction question the auditor controls; where not, the received file is treated as unverified until reconciled. A finding built on an unverified file is a finding management can dismiss by questioning the file, and usually will.
Data handling, privacy and retention
Analytics evidence is often personal or sensitive data (payroll, customer, health, card data), and the documentation standard has to coexist with the data privacy obligations the organization is under. The practices: minimize (extract the fields the test needs, not the table), pseudonymize where identity is not needed for the test (hash the identifiers, keep the key separately), store extracts in the function’s controlled repository rather than on laptops or shared drives, encrypt at rest, restrict access to the engagement team, and retain under a policy that sets a period for analytics data shorter than for the workpaper itself where the law requires (the workpaper keeps the counts, totals, script and a sample; the full extract is deleted at the retention date with the deletion recorded). Cross-border data has its own constraints, and extracts of regulated data (card data under PCI DSS, health data under HIPAA) may need the organization’s security team involved before the auditor takes a copy. The workpaper records where the data is, who can reach it and when it will be deleted, which is itself evidence that the function handles data the way it expects the business to.
Second-person review of analytics
Code is reviewed differently from a memo. The reviewer reads the script against the stated logic (does the filter implement the rule the memo describes; does the join lose rows; is the threshold the one the memo states; are dates handled correctly across the period boundary), checks the completeness reconciliations, re-runs the analytic or recalculates a portion (a subset of the rules on a subset of the data, by a different route where possible: a pivot table against the script’s aggregate), traces a handful of exceptions from the output back to source documents, and reads the exception dispositions for consistency. The review is documented as review notes with the re-performance results, and the sign-off attests to the logic as well as the memo. For analytics that will support a High finding or a regulatory validation, the re-run is mandatory; for routine analytics, a recalculation of totals and a trace of exceptions suffices. Functions with a data team add a code review convention (a second analyst reads every evidence script before results are used), which is where most join and date errors are caught. The QAIP playbook places analytics review within the function’s quality program.
When others rely on the analytic
Three readers may rely on an analytics workpaper beyond the engagement team, and each raises the bar. The external auditor considering internal audit’s work for its own procedures will ask for the population reconciliation, the logic, the versioning and the review evidence before placing any reliance, and will often re-perform a portion; a workpaper that meets the standard here saves the organization fees, and one that does not costs internal audit its credibility with the firm. The regulator reviewing an issue validation or a remediation program (the closure standards guide’s territory) treats analytics as evidence only where the chain is complete, and examiners have overturned validations built on unreconciled extracts. And management, when an analytic becomes the monitoring hook the sustainability guide describes or a continuous monitoring rule, inherits the script, which means the documentation must be good enough for a non-auditor to run and maintain it: a readme, named parameters, a change log and a named owner. Writing for these readers from the start costs an hour per analytic and is the difference between evidence and an interesting list.
Results and interpretation
An analytic produces candidates, not conclusions, and the interpretation stage is where the auditor’s judgment enters and must be documented. For each rule, the workpaper records how many rows fired, how the candidates were triaged (all investigated; a sample investigated with the basis; categories cleared by a secondary rule), the false positive rate found and what it says about the rule, the exceptions confirmed and their disposition (error, control failure, fraud indicator referred, policy question), and the conclusion against the objective in terms of the population (an exception rate, a dollar effect, a statement about the control). Thresholds and materiality used in triage are stated and justified; a duplicate-payment rule that ignores pairs under $100 is a design choice the reader should see. Where the analytic replaces a sample, the workpaper says so and addresses what the analytic cannot see (an exception type the rules do not cover), so that the conclusion is scoped to what was tested. The journal entry, accounts payable and payroll analytics guides give the rule sets whose interpretation this stage documents.
A worked example: MidState Beverage’s duplicate payment analytic
MidState Beverage is the mid-size beverage company used in the process examples on this site; its accounts payable audit (described in the AP analytics guide) found 41 likely duplicate payments totalling about $286,000, with the exact-match check switched off since a system migration. The analytics workpaper that supported the finding, summarized here, is the standard this guide describes.
| Stage | What the workpaper recorded |
|---|---|
| Source | ERP accounts payable payment table and invoice table (named), owned by the controller; chosen because payments are the population of the objective (payments to vendors in FY25); vendor master for names and bank details; data dictionary for the 14 fields used |
| Extraction | Direct SQL extraction by the audit data analyst on 3 March 2026 at 14:10 under read-only audit access; parameters: payment date 1 January to 31 December 2025, all companies, status posted; raw counts 184,212 payments, $412.6 million; query text saved as extract_payments_fy25.sql, commit a3f9c1 |
| Completeness | Payment total reconciled to the FY25 cash disbursements per the general ledger ($412.9 million): difference $0.3 million explained as payroll disbursements posted through a separate module and excluded by design; record count reconciled to the ERP’s own count query run separately (184,212) |
| Transformation | Script dup_rules_v2.py (commit 7be044): standardization of vendor names and invoice numbers (case, punctuation, leading zeros) with the rules listed; five duplicate rules (same vendor, invoice number and amount; same vendor and amount within 7 days with different invoice numbers; same invoice number and amount with different vendor identifiers sharing bank details; same amount and date across related vendors; sequential invoice numbers with identical amounts); thresholds (amounts over $100) and date windows stated with reasons; join keys and types documented; nulls handled by exclusion with counts |
| Result | Candidates by rule: 1,140 in total, 184,212 payments in equals 1,140 candidates plus 183,072 non-candidates (reconciled); output preserved as dup_candidates_fy25.csv with a hash recorded |
| Interpretation | All 1,140 candidates triaged: 1,021 cleared as legitimate recurring payments or credit-rebill pairs by a secondary rule (documented), 78 investigated to invoices and cleared, 41 confirmed duplicates ($286,000; 38 recovered, $241,000) with dispositions; false positive analysis by rule recorded (rule 4 fired mostly on legitimate related-vendor payments and was flagged for redesign); conclusion: the exact-match control had not operated since the migration date, confirmed by configuration inspection |
| Versioning and environment | Python 3.12 with the requirements file committed; scripts at the commits named; analysis frozen 10 March 2026; extract retained in the audit repository, encrypted, deletion scheduled March 2027 with counts, totals and a 200-row sample retained with the workpaper |
| Review | Audit manager read the script against the memo, re-ran rule 1 independently in SQL (same 611 candidates), traced 10 confirmed duplicates to invoices and bank records, and signed off with two notes (a date boundary fix in rule 2, re-run with no change to confirmed duplicates) |
When the external auditor asked to rely on the work for its own duplicate-payment procedures, the workpaper answered every question without the analyst in the room, which is the test. The risk and control matrix template guide tells the rest of the MidState AP story.
The analytics workpaper template
| Section | Content |
|---|---|
| Header | Engagement, objective and test reference; analyst; reviewer; dates run and frozen; version identifiers of scripts |
| Purpose and assertion | What the analytic tests, in terms of the objective; the population it must cover |
| Data lineage | Sources (system, table or report, owner), fields used with definitions, known limitations |
| Extraction | Method, parameters, timestamp, access, raw counts and totals, file names and locations |
| Completeness reconciliation | Independent figure, arithmetic, explained differences |
| Logic | Transformation and rule descriptions in plain language, cross-referenced to the script lines; thresholds with reasons |
| Results | Counts by rule; input-output reconciliation; preserved output |
| Interpretation | Triage approach; false positive analysis; exception dispositions; conclusion and limitations |
| Environment and retention | Tool and versions; repository references; data location, access and deletion date |
| Review | Reviewer’s procedures (read, re-run, trace), notes, resolution, sign-off |
Failures that recur
| Failure | How it shows | Fix |
|---|---|---|
| Screenshot as evidence | The top of a table, undated | Preserve the output file with counts and a hash |
| Unproven population | No reconciliation, or reconciled to itself | Independent figure; both ends of the chain |
| Logic in spreadsheets | Filters and formulas nobody can list | Transform in a scripted tool; spreadsheets for presentation |
| Script edited after the result | Numbers irreproducible | Freeze and version; record the commit |
| Default joins | Rows silently lost | Explicit join types; input-output reconciliation |
| Date boundaries | Period-end transactions excluded or doubled | Inclusive and exclusive bounds stated; time zones considered |
| Exceptions equal findings | 1,140 “issues” reported | Triage, false positive analysis, dispositions |
| Received files unverified | Management disputes the data | Extract directly or test the IPE |
| Data on laptops | Privacy breach risk; evidence lost | Controlled repository, encryption, retention schedule |
| Review by signature | Reviewer never opened the script | Read, re-run, trace; document it |
Questions about documenting analytics
What must an analytics workpaper contain?
The evidence chain: the source and why it fits the assertion, the extraction method and parameters with timestamp and raw counts, a completeness reconciliation to an independent figure, the transformation logic as a readable and frozen script, the preserved results with an input-output reconciliation, the interpretation (triage, false positives, dispositions, conclusion), the environment and version identifiers, data handling and retention, and a documented second-person review.
How do you prove an extract is complete?
Reconcile its record count and control totals to a figure that did not come from the same extraction (the ledger, the system’s own count, a prior audited total, a hash total), explain every difference, and repeat the reconciliation at the output: rows in equal rows out plus rows excluded, with reasons.
What does reproducibility require?
A frozen, versioned script; the preserved extract (or its counts, totals and a sample where the data cannot be kept); the tool and package versions; and a workpaper clear enough that another auditor can regenerate the result and reach the same conclusion. The reviewer’s re-run is the test.
Can Power Query or Excel work be audit evidence?
Power Query can, if the applied steps are exported as code to the workpaper, the source and refresh are controlled and the evidence copy is frozen. Spreadsheet transformations with manual edits, pasted values and unlisted filters cannot be defended; use spreadsheets to present results, not to produce them.
How should exceptions from an analytic be reported?
As candidates triaged to confirmed exceptions with dispositions, never as a raw count: state how many rows fired, how they were cleared or investigated, the false positive rate and what it says about the rule, the confirmed exceptions and their effect, and the conclusion in terms of the population, with the thresholds and the limits of what the rules can detect stated.
How long should analytics data be retained?
Under a policy that balances the workpaper retention period against privacy law: keep the script, counts, totals and a sample with the workpaper for its full retention, and delete full extracts of personal or regulated data on a shorter schedule, recording the deletion. Store extracts in a controlled, encrypted repository with access limited to the engagement team.
Related guides
- SQL for auditors — writing the queries this guide documents.
- Internal audit workpapers: a beginner’s guide — the general standard.
- Audit workpaper example — the surrounding file.
- Workpaper best practices — quality and consistency.
- Audit evidence — reliability, relevance, sufficiency.
- IPE testing — reports and files produced by the entity.
- How to audit account reconciliations — the reconciliation discipline borrowed here.
- Accounts payable analytics — the MidState analytic.
- Journal entry analytics — rule sets to document.
- Payroll analytics — rule sets with personal data.
- Procurement fraud analytics — fraud rules and their interpretation.
- Risk and control matrix template — the rest of the MidState AP story.
- Alteryx vs Power Query and Power BI — the tools.
- CaseWare IDEA review — ACL-era tooling.
- ACL Analytics review — scripting and logs.
- IT change management audit — the standard applied to the auditor’s own code.
- Data privacy audit — handling extracts of personal data.
- QAIP playbook — analytics review in the quality program.
- Continuous auditing — analytics that run on a schedule.
- Continuous monitoring on a small budget — the same documentation standard for recurring rules.
- Top five data analytics skills for internal audit — the skills behind the work.

Leave a Reply