Like the queries shared in the config tab of the initial Google Sheet, the orange-shaded cells on each of the templates we’ve posted are queries that return as-filed data for companies reporting to the SEC. These queries can be copied out pasted to another sheet, or modified (generally with the green variable cells, as with the ticker cell) to return other data.
For example, if you put the ticker IBM in your copy of the Balance Sheet Compare – SEC Filers Google Sheet (contributed by Peter Guldberg), then scroll down to the corresponding filing detail for the company (row 92 or below), columns F and K have queries that return data used in the presentation at the top of the spreadsheet.
Further, if you copy the corresponding F and K cells from your copy of the Balance Sheet Compare – SEC Filers to another worksheet and ‘paste special’ >> ‘paste values only’ between the quotes of the function =showData(“insert query here”) the query will run again and the data will appear. Reminder – at this point, the query is no longer tied to Peter’s TaxonomyMap – this sheet does the heavy lift of analyzing each report to find a matching element in the filing from several choices, then builds the query that was copied out based on what’s discovered. As a result, another company might not return facts for these same elements.
The API takes a ‘plain-language’ approach to the granularity that is the hallmark of XBRL. In the IBM example, the query (URL) is like a sentence: “For the facts from report A and in the year B and for quarter C and without dimensions and named D return fields sorted by name showing the value, decimals, fiscal year, period and unit for each. The documentation list parameters that can be applied to filter data and fields that can be returned.
Additionally, recognize that Peter ‘daisy-chained’ results from a prior query of reports to identify the report.id
of the most recent one filed for the ticker. On the API, report.id
and dts.id
are unique identifiers for filings.