650 likes | 858 Views
21 st XBRL International Conference “One Language, Common Vision: Role of XBRL Technology in the Post Crisis Era” 19-21 October 2010 Beijing, China. XBRL Technology Track TECH7, Formula Formula Overview Herm Fischer October 20, 2010. Historical Perspectives.
E N D
21st XBRL International Conference“One Language, Common Vision: Role of XBRL Technology in the Post Crisis Era”19-21 October 2010Beijing, China XBRL Technology Track TECH7, Formula Formula Overview Herm Fischer October 20, 2010
Historical Perspectives • 2002 - FDIC contract motivates solutions • “ - Rule base Requirements IWD • 2003 - XPath syntax chosen • “ - Functions spec drafted. • 2004 - Formula drafts, some implementations • 2006 - Alternative approach with XQuery • 2007 Jan- Issued Formula PWD • Feb, Mar - Survey of users, feedback • June, Dec, Feb – PWD updates after PWD feedbacks • Mar 2008 – Candidate Release (spec) & Test Suite • May 2008 – Implementations of processors • Sept 2008 – Production formulas (COREP, FINREP) • Dec 2008 – CR-2 (dimensions and other fixes) • Jun 2009– Recommendation • 2010– CR extension modules
Formulas & Assertions • Formula • Results in an fact item • For an output instance document • For consistency checking of corresponding input • Assertion • Consistency check computed item to source item • Existence check for source item • Value check based on source items
Process flow of formula linkbase Formula LB* Output inst.computedfact items Input inst.DTS contextsunitsfact items FormulaProcessor Assertionsconsistency existence value *Formula LB is part of DTS
Input instance processing • Instance: producer’s taxonomy, facts, and producer’s formulas • Consumer may have their own formulas • Processor evaluates formulas and assertions • Processor may produce output instance with result fact items • User’s application may report based on assertion test results
Formula linkbase contents Formula LB* arc formula assertion Parameter(select expr.) variable filter customfunction precondition label ref. Input inst.DTS contextsunitsfact items Output inst. computed fact items FormulaProcessor Assertionsconsistencyexistence value *Formula LB is part of DTS
Consistency assertion processing Formula LB* • For each consistency assertion • For each arc-connected formula • Evaluate variables to produce resulting fact item • Compare to matching item in source instance document FormulaProcessor Assertionsconsistencyresult Input inst.DTS contextsunitsfact items Output inst.computedfact items *Formula LB is part of DTS
Formula processing Formula LB* • For each/any formula (unordered) • Evaluate parameters (if any) • Filter/bind variables by dependency • Nested variable iteration • Test precondition (if any) • Evaluate value • Produce output fact FormulaProcessor Input inst.DTS contextsunitsfact items Output inst.computedfact items *Formula LB is part of DTS
Value assertion processing Formula LB* • For any value assertion • Evaluate parameters (if any) • Filter/bind variables by dependency • Nested variable iteration • Test precondition (if any) • Evaluate value assertion expression FormulaProcessor Input inst.DTS contextsunitsfact items Assertionsvaluetestingresult *Formula LB is part of DTS
Existence assertion processing Formula LB* • For each existence assertion • For each set of evaluated variables • Count successful evaluations • Apply a test to the count FormulaProcessor Input inst.DTS contextsunitsfact items Assertionscount testresult *Formula LB is part of DTS
Value assertion test of assets • Test that “assets = liabilities + equity” • Input instance has assets, liabilities, and equity • Value assertion tests to threshold(assets – (liabilities + equity)) < threshold
Assets sum test, flow • Processing flow Formula LB* FormulaProcessor Assertion.result Input inst.DTS assets, liab, equity *Formula LB is part of DTS
Input instance <context id="context"> <entity> <identifier scheme="http://xbrl.org/entity/identification/scheme">01</identifier> </entity> <period> <instant>2007-12-31</instant> </period> </context> <unit id="unit"> <measure>iso4217:EUR</measure> </unit> <eg:assets precision="0" contextRef="context" unitRef="unit">12345.60</eg:assets> <eg:equity precision="0" contextRef="context" unitRef="unit">23456.70</eg:equity> <eg:liabilities precision="0" contextRef="context" unitRef="unit">-11111.10 </eg:liabilities>
Assets sum test, instances • Instance document input has values to test • Output assertion results
Assets sum test, assertion <va:valueAssertionxlink:type="resource" xlink:label="assertion" id="assertion" aspectModel="dimensional" implicitFiltering="true" test="abs($assets - ($equity + $liabilities)) le 0.01"/>
Fact variables <va:valueAssertionxlink:type="resource" xlink:label="assertion" id="assertion" aspectModel="dimensional" implicitFiltering="true" test="abs($assets - ($equity + $liabilities)) le 0.01"/> <variable:variableArcxlink:type="arc“ xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set" name="assets" xlink:from="assertion" xlink:to="vAssets" order="1.0"/> <variable:factVariablexlink:type="resource" xlink:label="vAssets" bindAsSequence="false"/>
Concept filter • Filter by name of concept • Filter by facet of concept • Balance • Data type • Substitution group • Period type • Custom attribute
Concept name filter • Use a concept filter on each variable <cf:conceptNamexlink:type="resource" xlink:label="filter_assets“> <cf:name strict=“true”> <cf:qname>c:assets</cf:qname> </cf:name> </cf:conceptName>
Alternatives • We have used a value assertion • A formula produces an output fact item • E.g., produce result assets = equity + liabilities (instead of value assertion) • A consistence assertion compares formula to input fact • E.g., produce result assets and compare to input assets
Period filter • Match completely another variable’s period • Match date date/time of: • periodStart • periodEnd • periodInstant • forever • instantDuration (to a duration factVariable) • Matching by an XPath expression
Period filter - Movement example • Ending balance = starting balance + changes • Inputs have cross-context matching • Starting balance’s date matches duration’s start • Ending balance’s date comes from duration’s end
Movement example <eg:balance precision="0" contextRef="I-2007" unitRef="unit">12345.60</eg:balance> <eg:changes precision="0" contextRef="D-2008" unitRef="unit">11111.10</eg:changes> <eg:balance precision="0" contextRef="I-2008" unitRef="unit">23456.70</eg:balance>
Use case, movement example <pf:instantDuration variable="changes" boundary=“start" /> <pf:instantDuration variable="changes" boundary="end" />
Implicit filter, changes Carried forward uncovered aspects Default implicit search aspects Explicit aspect from variable definition Search aspects for Variable = + covered aspect
Implicit filter, beginning balance Uncovered aspects search criteria Explicit aspects from variable definition Carried forward uncovered aspects Search aspects for variable = + covered aspect
Aspects • Location (tuple nesting) (both tuple & item) • Concept (namespace & name) ( “ ) • Entity identifier (item only) • Period ( “ ) • Dimension (seg/scen agnostic) • Segment (complete, or nonXDT) ( “ ) • Scenario ( “ ) ( “ ) • Unit (numeric items only)
Implicit scenario & segment issues • Dimensional implicit filters • Dimension contents are matched with d-equals • Remaining contents matched with s-equals • Non-dimensional implicit filters • Contents matched with s-equals
Tuple filter • ParentTuple • Concept name of the fact’s tuple parent • AncestorTuple • Concept name of a fact’s ancestor • TupleSibling • Another variable’s fact is a sibling of this fact • TupleLocation • Another variable’s fact is a given relation to this fact • E.g., $a is “../eg:tupleB/*” related to this fact
GL-based tuple examples (tuples in, non-tuples out) • Trial balance in-balance checks • For each entry details section check if in-balance • Output string result item (for this example) • Trial balance ending balances report • For each account add changes to balance brought fwd • Aggregate account across entry detail sections • Output string result item (acct name & ending balance) • (Research into tuple generation is discussed later)
GL trial balance check <xbrli:xbrl> <gl-cor:accountingEntries> <gl-cor:entryHeader> <gl-cor:qualifierEntry …>balance-brought-forward</ …> <gl-cor:entryDetail> <gl-cor:amount …>242678.26</ …> <gl-cor:debitCreditCode …">D</ …> </gl-cor:entryDetail> … </ gl-cor:entryHeader> <gl-cor:entryHeader> <gl-cor:qualifierEntry …>standard</ …> <gl-cor:entryDetail> <gl-cor:amount …>242678.26</ …> <gl-cor:debitCreditCode …">D</ …> </gl-cor:entryDetail> … </ gl-cor:entryHeader> </ gl-cor:accountingEntries> </ xbrli:xbrl> accountbalances D – debit C - credit period’schanges Check if sections are in balance: sum(amts with ‘D’ siblings) = sum(amts with ‘C’ siblings)
General filter • Just an XPath 2 expression • Need to test if sibling of amount is credit code <gl-cor:entryDetail> <gl-cor:amount …>242678.26</ …> <gl-cor:debitCreditCode …">D</ …> </gl-cor:entryDetail> • test=“../gl-cor:debitCreditCode eq ‘D’”
Value filter • Value matches an XPath 2 expression • Not Nil test • Nil test • Precision expression
GL ending balance computation <xbrli:xbrl> <gl-cor:accountingEntries> <gl-cor:entryHeader> <gl-cor:qualifierEntry …>balance-brought-forward</ …> <gl-cor:entryDetail> <gl-cor:account> <gl-cor:accountMainID …>5100</ …> <gl-cor:accountMainDescription …>Supplies</ …> <gl-cor:accountType …>account</ …> </gl-cor:account> <gl-cor:amount …>242678.26</ …> <gl-cor:debitCreditCode …">D</ …> <gl-cor:xbrlInfo> <gl-cor:xbrlInclude …>beginning_balance</…> </gl-cor:xbrlInfo> </gl-cor:entryDetail> … </ gl-cor:entryHeader> <gl-cor:entryHeader> <gl-cor:qualifierEntry …>standard</ …> <gl-cor:entryDetail> … </gl-cor:entryDetail> … </ gl-cor:entryHeader> </ gl-cor:accountingEntries> </ xbrli:xbrl> aggregate by account skip ending_balances
GL ending balance test • Added 2 more variables • For each account • Get amount for ending-balance entry with ‘C’ (credit) code • Get amount for ending-balance entry with ‘D’ (debit) code • Change equation to test • Sum (credits which are not ending-balance - debits which are not ending-balance + credit which is ending-balance – debit which is not ending-balance) < 1.00
GL example code • Try it, examine it, execute it online: • Directory …examples\0007 GL Examples • Instance-trial-balance-check.xml • Instance-test-ending-balance.xml • Instance-compute-ending-balance.xml
Dimension filter • Explicit Dimension filter • Fact has QNamed dimension (in context or default) • Constrains to QNamed member(s), or their children or descendants • Typed Dimension filter • Typed dimension is specified by QName • XPath 2 expression tests dimension value
Dimension filter, implicit interactions • Primary items with multiple dimensions • Dimensions explicity filtered • Remaining dimensions implict matched • Remainder of segment/scenario implicit matched • Example has 2 dimensions (product, region) • Aggregation check by product or region requires implicit matching of other dimension
Dimension aggregation • Test aggregation of each member • Products & region dimensions have member hierarchy
Pharmaceutical example • Multiple periods for used dimensions • Multiple dimensions per contexts (Charlie’s aggregation example)
Two dimensions to check • Will require checking of aggregation for • Product dimension • Region dimension • Formula shown for product dimension(region is same except for dimension name) • Demonstrates mixed explicit/implicit dimension filtering