1 / 74

16 th XBRL International Conference Demystifying XBRL Formulas December 5, 2007 Herm Fischer

16 th XBRL International Conference Demystifying XBRL Formulas December 5, 2007 Herm Fischer. Overview. Why, who needs formulas for what? Historical perspectives Process flow of formulas Formula Linkbase Contents Formula processing Features by use case example DTS discovery Functions

malana
Télécharger la présentation

16 th XBRL International Conference Demystifying XBRL Formulas December 5, 2007 Herm Fischer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 16th XBRL International Conference Demystifying XBRL Formulas December 5, 2007 Herm Fischer

  2. Overview • Why, who needs formulas for what? • Historical perspectives • Process flow of formulas • Formula Linkbase • Contents • Formula processing • Features by use case example • DTS discovery • Functions • Built-in • End-user • Roadmap

  3. Why formulas Calculation Linkbase is Enough • Roll-ups validates item sums • Addition within equal context • Period, entity, dimension are equal Calculation Linkbase Can’t Do • Cross context • Movement (start + changes = end) • Dimensions • Business rules

  4. Historical Perspectives • 2002 - FDIC contract motivates solutions • Conceptual prototype based on XSL • Excel-like, implicit matching (now in use) • “ - 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 – PWD update based on survey feedback • Dec (late) – PWD-2

  5. Original motivationEffective exchange of data • Information producer • Validate data types and values • Consistency and quality checks • Information consumer • (ditto) • Completeness checks • Augment received data with calculated values • Augment received data with annotations

  6. XBRL without formulas • Calculation linkbase • Well behaved roll-ups of compatible numerical values • (Proposed) Aggregation of dimensional values • Calculation linkbase can’t do • Cross-context (ending bal = starting bal + changes) • Cross-unit (dollars = price per share X nbr shares) • Dimensional aggregation (all = red wine + white wine) • Missing items checks • Threshold and limits (sum amounts ± €5)

  7. Process flow of formulas Formula LB* Output inst.computedfact items Input inst.DTS contextsunitsfact items FormulaProcessor *Formula LB is part of DTS

  8. Input instance processing • Instance provides producer’s taxonomy, facts, and producer’s formulas • Consumer may have their own formulas, their own resulting items taxonomy • Formula processor ‘fires’ formulas that match to input fact items • Formula processor produces output instance with result fact items

  9. Formula linkbase contents Formula LB* formula arc precondition Parameter(select expr.) variable filter customfunction loc label ref. Input inst.DTS contextsunitsfact items Output inst.computedfact items FormulaProcessor *Formula LB is part of DTS

  10. Formula processing Formula LB* • For each/any formula (unordered) • Evaluate parameters (if any) • Filter/bind variables in their order • 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

  11. Assets sum test, pseudo code • Test that “assets = liabilities + equity” • Input instance has assets, liabilities, and equity • Output boolean test result, true or false

  12. Assets sum test, flow • Processing flow Formula LB* FormulaProcessor Output inst.Test resultboolean Input inst.DTS assets, liab, equity *Formula LB is part of DTS

  13. Assets sum test, instances • Instance document input has values to test • Output is the boolean result of testing the sum units match same context

  14. Assets sum test, formula linkbase

  15. Assets sum test, formula resources

  16. Assets sum test, formula - compiled

  17. Assets sum test, formula execution

  18. Assets sum test, formula input

  19. Variation: Compute the assets • Prior example tested assets = equity + liabilities • 3 inputs (assets, equity, liabilities) • 1 output (boolean test) • Now no input sum - compute sum as the result • 2 inputs (equity, liabilities) • 1 output (monetary assets)

  20. Compute assets, taxonomy • Taxonomy has monetary concepts for assets, liabilities, equity • Here output is the assets concept (vs. boolean) Last example:

  21. Compute assets, instances • Instance document input has values to add • Output is the monetary result of adding the sum units match same context

  22. Compute assets, formula linkbase

  23. Formula linkbase resources • Parameter • Function declaration • Formula • Variables • Filters • Precondition • Generic label • Generic reference

  24. Parameter resources • Provide input parameters to formula processor • From external source (invocation of processor) • Or from XPath expression in Parameter • May be required (or optional) • Evaluated before any formula variable (Parameter resources can have arcs to labels & references)

  25. Function declaration resources • Declare functions usable in XPath expressions • May be user-supplied • May be built-in to formula processor • May relate to formula registry • Function input parameters • Order, data type • Function name • Function output data type (Function declarations can have arcs to labels & references)

  26. Formula resource • Value expression • Concept (either fact variable name or arc to loc) • Context & Unit (where needed) • Fact variable reference (copy from fact variable) • Override facets by xml (e.g., period, measure) • Arcs to variables, precondition (Formula resources can have arcs to labels & references)

  27. Variable resources • Fact variables • Bind to input instance fact items/tuples • Arcs to filters constrain which input facts to bind to • Iterates through filtered input facts or returns sequence • General variables • An XPath expression (not to input fact nodes) • Produce sequence or individual atomic results • No arcs to filters • Order in formula by dependency of variables & filters (Variables may have arcs to labels & references)

  28. Filter resources • Specify a facet to use as fact predicate • Have arc(s) from fact variable(s) • Available filter facets • Concept, Dimension, Entity, Period, Tuple, Unit, Value, and General (XPath expression) • Implicit filtering • Automates matching non-explicitly filtered facets • Variable-set • PWD 2 feature facilitating filter grouping (Filters can have arcs to labels & references)

  29. Precondition resource • Provides an XPath expression to test • Runs after parameters and variables are bound • Arc-connected from formula resource(s) • PWD 2 adds variable-set precondition feature (Preconditions can have arcs to labels & references)

  30. Generic label resources • Annotates descriptive text on any • Resource (e.g., any in formula LB) • Element in xsd (e.g., concept, arc type, etc.) • Arc connected (from resource or element) • Unconstrained contents

  31. Generic reference resources • Provides link:part’s to any • Resource (e.g., any in formula LB) • Element in xsd (e.g., concept, arc type, etc.) • Arc connected (from resource or element)

  32. Fact variable filters • Concept filter • Dimension filter • Entity filter • General filter • Period filter • Tuple filter • Unit filter • Value filter • PWD-2 additions: Boolean, Match, Relative

  33. Concept filter • Filter by name of concept • Filter by facet of concept • Balance • Data type • Substitution group • Period type • Custom attribute

  34. Concept name filter • Sum test uses a concept filter on each variable <cf:conceptName xlink:type="resource" xlink:label="filter_assets“> <cf:name strict=“true”> <cf:qname>eg:assets</cf:qname> </cf:name> </cf:conceptName>

  35. Period filter • Match completely another variable’s period • Match date date/time of: • periodStart • periodEnd • periodInstant • periodInstantDuration • Matching by an XPath 2 expression

  36. PeriodStart filterMovement example • Ending balance = beginning balance + changes • Inputs have cross-context matching • Starting balance’s date matches duration’s start • Ending balance’s date comes from duration’s end

  37. Use case, movement example

  38. Period filter • PeriodStart filter matches change’s duration start dateto beginningBalance’s instant date <pf:periodStart date=“xfi:period-instant( xfi:period($beginningBalance))” />

  39. Aspects • Location (tuple nesting) (both tuple & item) • Concept (namespace & name) ( “ ) • Entity identifier (item only) • Period ( “ ) • Segment (complete, nonXDT, or dimension) ( “ ) • Scenario ( “ ) ( “ ) • Unit (numeric items only)

  40. Implicit filter, beginning balance Carried forward Implicit Search Criteria Default Implicit Search Criteria Explicit Criteria from Variable Definition Search Criteria for Variable = +

  41. Implicit filter, changes Beginning Balance Implicit Search Criteria Explicit Criteria from Variable Definition Carried forward Implicit Search Criteria Search Criteria for Variable = +

  42. 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

  43. Result concept taken from input fact • Result concepttakes conceptof a boundvariable insteadof loc & arc

  44. Movement example • Try it, examine it, execute it online: • Directory …\xml\examples\0004 Movement

  45. Use case, stock flow • Ending stock = starting stock + inflow – outflow • Starting context (instant at start date) • Flow/change context (duration from start to end) • Ending context (instant at end date) • Inputs have cross-context period matching • Starting stock’s instant date matches inflow & outflow duration starts • Both inflow & outflow need periodStart matching • Output result (ending stock) gets inflow/outflow duration ending date • Formula specifies period for ending stock

  46. Use case, stock flow result’s period is duration end period start filtering

  47. Stock Flow example • Try it, examine it, execute it online: • Directory …\xml\examples\0003 Stock Flow

  48. 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

  49. 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)

  50. 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)

More Related