Audit
  • 3 Minutes to read
  • Dark
    Light
  • PDF

Audit

  • Dark
    Light
  • PDF

Article summary

Creates a file or table(s) that Audits the active project.  

Data Audit
The Data Audit report can be used to create an audit table via the desktop user interface.  See Data Audit
KeyValue(s)description
methodAuditCreates 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? 
filenamePath 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?
tableNameName 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...}
profilestrue/falseIf 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.
stackTableNameName 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...}
continuousoptional.   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 auditWill be ignored if metadata property is not found.  See Getting Started - Categories and Metadata for more information on metadata.
includeAllMetadatatrue/falseIf true, all metadata will be appended to stackTableName and TableName.  See Getting Started - Categories and Metadata for more information on metadata. 
projectActive project name
targetProject"ProjectName"Name of project to audit


Examples

The following shows the blank Audit method that is inserted from Script Editor | Methods | Audit | Audit

{
  "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}
{
	"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)

{
  "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} 
{
  "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}
{
  "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:

{
  "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}
{
  "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:

  {
    "method": "Audit",
    "tableName": "audit",
    "stackTableName": "stack",
    "includeMetadata": [
      "Categories"
    ],
    "project": "Demonstration"
  }
 


The following will append all metadata to the audit and stack tables:

 {
    "method": "Audit",
    "tableName": "audit",
    "stackTableName": "stack",
    "includeAllMetadata": true,
    "project": "Demonstration"
  }





Was this article helpful?