default_views¶
Define default SQLite views for created/updated database file.
Module Attributes
List of the default views added to exported SQLite databases. |
|
Examine multi-language enclosures in an easy to read listing. |
|
Examine the age of the data on the filings. |
|
Examine summation errors and duplicate errors in filings. |
- xbrl_filings_api.default_views.DEFAULT_VIEWS: list[SQLiteView] = [SQLiteView(name='ViewEnclosure', required_tables=('Entity',)), SQLiteView(name='ViewFilingAge', required_tables=('Entity',)), SQLiteView(name='ViewNumericErrors', required_tables=('ValidationMessage', 'Entity'))]¶
List of the default views added to exported SQLite databases.
Accessible through the package root namespace.
- xbrl_filings_api.default_views.ViewEnclosure = SQLiteView(name='ViewEnclosure', required_tables=('Entity',))¶
Examine multi-language enclosures in an easy to read listing.
Filings in a single enclosure are defined to have the same
entity_api_id
,reporting_date
, andcountry
.Ordered ascending on
entity_name
,reporting_date
.Columns¶
- entity_nameTEXT or NULL
From
Entity.name
.- reporting_dateTEXT or NULL
From
Filing.reporting_date
.- countryTEXT or NULL
From
Filing.country
.- filing_countINTEGER
Count of filings in the enclosure.
- languagesTEXT or NULL
Comma-separated list from
Filing.language
ordered alphabetically ascending. As the the values may beNULL
, this list may have fewer languages than there are actual filings.- filingApiIdsTEXT or NULL
Comma-separated list from
Filing.api_id
is the same order aslanguages
.- error_countINTEGER or NULL
Maximum from
Filing.error_count
values.- inconsistency_countINTEGER or NULL
Maximum from
Filing.inconsistency_count
values.- warning_countINTEGER or NULL
Maximum from
Filing.warning_count
values.- added_timeTEXT or NULL
Earliest date from
Filing.added_time
.- processed_timeTEXT or NULL
Latest date from
Filing.processed_time
.- entity_identifierTEXT or NULL
From
Entity.identifier
.- entity_api_idTEXT
From
Entity.api_id
.
- xbrl_filings_api.default_views.ViewFilingAge = SQLiteView(name='ViewFilingAge', required_tables=('Entity',))¶
Examine the age of the data on the filings.
Ordered ascending on
dataAgeDays
.Columns¶
- entity_nameTEXT or NULL
From
Entity.name
.- reporting_dateTEXT or NULL
From
Filing.reporting_date
.- languageTEXT or NULL
From
Filing.language
.- dataAgeDaysINTEGER or NULL
Age of the data in the filing in full days.
- countryTEXT or NULL
From
Filing.country
.- added_timeTEXT or NULL
From
Filing.added_time
.- processed_timeTEXT or NULL
From
Filing.processed_time
.- addedToProcessedDaysINTEGER or NULL
Days passed from
Filing.added_time
toFiling.processed_time
in full days.- filing_api_idTEXT
From
Filing.api_id
.- entity_api_idTEXT
From
Entity.api_id
.
- xbrl_filings_api.default_views.ViewNumericErrors = SQLiteView(name='ViewNumericErrors', required_tables=('ValidationMessage', 'Entity'))¶
Examine summation errors and duplicate errors in filings.
The purpose of this view is to reduce the set of validation messages to the ones most relevant from an accounting reliability perspective.
Ordered starting from the most severe error based on
errorPercent
. The last rows are typically rounding errors.A summation error arises in the filing when the reported data points and reported calculation tree (calculation linkbase) do not match. A duplicate errors arises when there is one data point which is reported twice (e.g. net income on income statement and cash flow statement) but with different values.
The view only takes into account one language version of a single accounting disclosure. It is assumed that all language versions contain the same data but only language of the report differs. It is customary that entities reporting in ESEF format report in the language of their domicile and English. Selected language is NULL or the first occurrence in an alphabetically ordered list. It is assumed that filings are part of the same enclosure when they have the same entity
api_id
andreporting_date
.Duplicate errors are reported twice in the data but these duplicates are reported only once in the view. A serious caveat for duplicates is that the source data does not report the line item element name. Duplicates are matched solely based on their numeric values in the same filing and thus there could be two different line items which have been both reported twice and with the exact same numeric values. This is also true with regards to reporting periods for the same line item (in other words, for a data point).
Columns¶
- entity_nameTEXT or NULL
Name of the entity from column
Entity.name
.- reporting_dateTEXT or NULL
Reporting date of the enclosure from column
Filing.reporting_date
.- problem{‘calc’, ‘duplicate’}
Type of matched validation message(s), ‘calc’ for summation errors and ‘duplicate’ for duplicate errors.
- reportedKREAL or NULL
Column
ValidationMessage.calc_reported_sum
for problem=’calc’ orValidationMessage.duplicate_lesser
for problem=’duplicate’ in thousands.- computedOrDuplicateKREAL or NULL
Column
ValidationMessage.calc_computed_sum
for problem=’calc’ orValidationMessage.duplicate_greater
for problem=’duplicate’ in thousands.- reportedErrorKREAL or NULL
Deviation from properly calculated value or the value of the other duplicate in thousands.
- errorPercentREAL or NULL
Percentage of error
reportedErrorK
based on reported value or lesser duplicate.- calc_line_itemTEXT or NULL
Line item element name from
ValidationMessage.calc_line_item
for problem=’calc’.- calc_short_roleTEXT or NULL
Short linkrole name (name of financial statement) from
ValidationMessage.calc_short_role
for problem=’calc’.- calc_context_idTEXT or NULL
Context ID of XBRL fact from
ValidationMessage.calc_context_id
for problem=’calc’.- languageTEXT or NULL
Language of the filing from
Filing.language
.- filing_api_idTEXT
Column
Filing.api_id
.- entity_api_idTEXT
Column
Entity.api_id
.- validation_message_api_idTEXT
Column
ValidationMessage.api_id
.