--- title: "Audit" slug: "audit" updated: 2025-01-14T17:15:45Z published: 2025-01-14T17:15:45Z canonical: "docs.datajet.app/audit" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # Audit Creates a file or table(s) that Audits the active project. Data AuditThe Data Audit report can be used to create an audit table via the desktop user interface.  See [Data Audit](/v1/docs/data-audit) | Key | Value(s) | description | | --- | --- | --- | | method | Audit | Creates summary and penetration tables for field objects. | | includeTables [] | [ table1, table2 ] | Optional. List of tables to include in the audit If omitted, all tables in the project will be included in the audit. TODO: How does this interact with excludeTables? | | excludeTables [] | [ table1, table2 ] | Optional. List of tables to exclude from the audit TODO: How does this interact with includeTables? | | filename | Path and excel file to export to. e.g., *%DATAPATH%Data_Audit_$DSTAMP%.xlsx* | Either **filename** or **tableName** must be present. TODO: Can file and table be created in same call? | | tableName | Name of table in which to store Audit summary data e.g., AUDIT_01 | Either **filename** or **tableName** must be present. Profiles are not created when exporting audit results to a table - see stackTableName for creating a single table of stacked profiles. An Audit summary table includes the following fields: - Table - Field - Discrete - Nulls - Enhanced - DType - Size - FType - Sorted - Min - Max - Width - MaxWidth - AvgWidth - Method - Description - Records - Null% - Full Name - Date - DateTime - {Metadata Fields...} | | profiles | true/false | If true, individual profiles will be created for each non-continuous field. Each profile is created in a separate worksheet. Profiles are not created when exporting audit results to a table. | | stackTableName | Name of table in which to output stacked profiles. | Creates a stacked Table containing discrete counts for all included fields. Continuous fields will be summarised using the specified Null and NonNull terms. Discrete fields that exceed the discrete threshold (**TODO: what is the maximum?**) will be summarized as continuous fields. An Audit summary table includes the following fields: - Table - Field - Value - Count - Percent - {Metadata Fields...} | | continuous | optional. true/false. | If true - Count, Percent and Value will be created as continuous fields in the stackTable. | | continuousNullTerm | "Not Populated" | term to use for null. | | continuousNonNullTerm | "Populated" | term to use for non-null. | | includeMetadata [] | Optional. List of metadata properties to include in the audit | Will be ignored if metadata property is not found. See [Getting Started - Categories and Metadata](/v1/docs/getting-started-categories-and-metadata) for more information on metadata. | | includeAllMetadata | true/false | If true, all metadata will be appended to stackTableName and TableName. See [Getting Started - Categories and Metadata](/v1/docs/getting-started-categories-and-metadata) for more information on metadata. | | project | Active project name | | | targetProject | "ProjectName" | Name of project to audit | | dataset{} | {} | Used in place of includeTable and excludeTable - will just produce an audit of the data in the dataset. | ### Examples The following shows the blank Audit method that is inserted from Script Editor | Methods | Audit | Audit ```json { "method": "Audit", "project": "", "filename": "", "tableName": "", "profiles": false, "includeTables": [], "excludeTables": [], "stackTableName": "", "continuous": false, } ``` The following will create 2 new tables: - Audit_Summary:    { Table, Field, Discrete, Nulls, Enhanced, Dtype, Size, Ftype, Sorted, Min, Max, Width, MaxWidth, AvgWidth, Method, Description} - Audit_Penetration:  {Table, Field, Value, Count, Percent} ```json { "method": "Audit", "tableName": "Audit_Summary", "stackTableName": "Audit_Penetration", } ``` The following will create an excel file called Data_Audit_0_-YYYY-MM-DD-HH-MM-SS.xlsx in the team output folder. It will contain an audit summary worksheet called "fields" for table "consumer" The fields worksheet will have the following columns: { Table, Field, Discrete, Nulls, Enhanced, Dtype, Size, Ftype, Sorted, Min, Max, Width, MaxWidth, AvgWidth, Method, Description) ```json { "method": "Audit", "includeTables": [ "consumer" ], "filename": "%OUTPUT%Data_Audit_0_%DSTAMP%.xlsx", "profiles": false, "project": "Discovery_03" } ``` The following will create an excel file called Data_Audit_2_-YYYY-MM-DD-HH-MM-SS.xlsx in the team output folder. It will contain 2 worksheets for everything except table "consumer": - **Fields**:  { Table, Field, Discrete, Nulls, Enhanced, Dtype, Size, Ftype, Sorted, Min, Max, Width, MaxWidth, AvgWidth, Method, Description} - **Penetration**: {Table, Field, Value, Count, Percent} ```json { "method": "Audit", "excludeTables": [ "consumer" ], "filename": "%OUTPUT%Data_Audit_0_%DSTAMP%.xlsx", "profiles": true, "project": "Discovery_03" } ``` The following will create 2 new tables summarising just table "**consumer**": - Audit_Summary:    { Table, Field, Discrete, Nulls, Enhanced, Dtype, Size, Ftype, Sorted, Min, Max, Width, MaxWidth, AvgWidth, Method, Description} - Audit_Penetration:  {Table, Field, Value, Count, Percent} ```json { "method": "Audit", "includeTables": [ "consumer" ], "tableName": "Audit_Summary", "stackTableName": "Audit_Penetration", "profiles": true, "project": "Discovery_03" } ``` The following is a blank entry or all method:audit parameters: ```json { "method": "Audit", "project": "", "filename": "", "tableName": "", "stackTableName": "", "continuous": false, "profiles": false, "includeTables": [], "continuousNullTerm": "Not Populated", "continuousNonNullTerm": "Populated", "includeAllMetadata": true, "includeMetadata": [], "excludeTables": [] } ``` The following will create 2 new tables summarising everything other than table "**consumer**": - Audit_Summary:    { Table, Field, Discrete, Nulls, Enhanced, Dtype, Size, Ftype, Sorted, Min, Max, Width, MaxWidth, AvgWidth, Method, Description} - Audit_Penetration:  {Table, Field, Value, Count, Percent} ```json { "method": "Audit", "excludeTables": [ "consumer" ], "tableName": "Audit_Summary", "stackTableName": "Audit_Penetration", "profiles": true, "project": "Discovery_03" } ``` The following examples show how to include metadata in audit tables: ```json { "method": "Audit", "tableName": "audit", "stackTableName": "stack", "includeMetadata": [ "Categories" ], "project": "Demonstration" } ``` The following will append all metadata to the audit and stack tables: ```json { "method": "Audit", "tableName": "audit", "stackTableName": "stack", "includeAllMetadata": true, "project": "Demonstration" } ```