Home › Forums › The XBRL API › Converting text to values and sorting data
- This topic has 5 replies, 2 voices, and was last updated 2 years, 5 months ago by David Tauriello.
-
AuthorPosts
-
-
Friday, June 3, 2022 at 6:56 PM #201133Asif SaberiParticipant
Hi David: Thanks for your pointers. I am able to download data into excel, but the downloaded data formatting must be text since I cannot do mathematical operations on returned values. I am also not able to force format the cells into which these values are returned or point to these cells from another pre-formatted cell. Appreciate any pointers.
-
Saturday, June 4, 2022 at 10:07 PM #201170Asif SaberiParticipant
Nevermind, I used the excel function VALUE… and it works.
- This reply was modified 2 years, 6 months ago by Asif Saberi.
-
Monday, June 6, 2022 at 1:46 PM #201243David TaurielloKeymaster
Asif – On the Excel version of XBRL Filed Data, if you choose the ‘Data’ option above the ‘Get’ button on XBRL Filed Data, you’ll get the values for fields. I believe the Function + Data (default) setting returns query results in a ‘Dynamic Array’ (this is a Microsoft feature).
-
Saturday, June 4, 2022 at 10:19 PM #201172Asif SaberiParticipant
Hi David (and others): Working in excel, when I pull several years of a ‘concept’ for one entity, how do I ensure it is sorted in a certain order. Return seems random…Here is my call and its result
=VALUE(XBRL.showData(CONCATENATE(B8,B10,B11,”&period.fiscal-period=Y&concept.local-name=”,$B17,”&fact.ha”,”s-dimensions=false&fact.ultimus=true&fields=fact.value,period.fisc”,”al-year, fact.limit(),fact.sort(), fact.offset()&”),””, “”, “0”))$20,289,000,000 2017
$38,016,000,000 2020
$25,913,000,000 2018
$48,844,000,000 2019
$34,940,000,000 2021-
Monday, June 6, 2022 at 7:33 AM #201236David TaurielloKeymaster
Hi Asif – you can use .sort(ASC|DESC) on fields that are being returned to design a sort order – see ‘sort’ in the documentation for details – https://xbrlus.github.io/xbrl-api
This functionality exists on the query tool in the side panel of XBRL Filed Data – use the arrow keys on the selected fields (which can also be re-ordered by dragging and dropping them) to sort fields.
-
-
Tuesday, July 12, 2022 at 7:11 AM #201137Asif SaberiParticipant
Another question:This pertains to using the entity.ticker in the search phrase-
The following works (the entity code is hard coded – CIK for AAPL):
=XBRL.showData(CONCATENATE(“https://api.xbrl.us/api/v1/fact/search?entity.code=0000320193&period.fiscal-year=2021&period.fiscal-period=Y&concept.local-name=”,$B12,”&fact.ha”,”s-dimensions=false&fact.ultimus=true&fields=fact.value,period.fisc”,”al-year,fact.limit(),fact.offset()&”),””, “”, “0”)But the following does not work (cell D5 contains the ticker for Apple inc, AAPL)
=XBRL.showData(CONCATENATE(“https://api.xbrl.us/api/v1/fact/search?entity.ticker=”, $D$5,”&period.fiscal-year=2021&period.fiscal-period=Y&concept.local-name=”,$B12,”&fact.ha”,”s-dimensions=false&fact.ultimus=true&fields=fact.value,period.fisc”,”al-year,fact.limit(),fact.offset()&”),””, “”, “0”)-
Tuesday, July 12, 2022 at 7:24 AM #201958David TaurielloKeymaster
Hi Asif – apologies for the slow reply; the
entity.ticker
parameter is not available as a filter for queries on thefact
endpoint. You should see the following message in your query:The following search parameter is not valid: entity.ticker
You’ll need to convert use another value (entity.id, entity.cik or entity.code) to return values for the entity.
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.
Search Forums
Recent Topics
Recent Replies
-
Spreadsheet Commands: Query Worksheet and Query Workbook Query Workbook 1 month, 3 weeks ago
-
Query for multiple dimensions 3 months, 3 weeks ago
-
Query for multiple dimensions 4 months ago
-
Showdata function 6 months, 2 weeks ago
-
Showdata function 6 months, 2 weeks ago
Documentation & Discussion
- Get started with Google Sheets OR
- Get started with Microsoft Excel OR
- Get access to as-filed data from us for other tools or your own app
- XBRL API Interactive Documentation
- Ten Tips & Techniques
- The XBRL API
- XBRL Data Community
- 2024 US GAAP Taxonomy Viewer
- Live support - Monday, 3:30 - 4:30 PM ET
Who's using this free data?
API Use 2024 || API Use 2023 || API Use 2022 || API Use 2021 || API Use 2020 || API Use 2019 || API Use 2018
Join XBRL US
- Individual Options - Basic, Power User & Sole Practitioner
- For Your Team - Startup, Non-Profit, Academic & Corporate options
- Member Benefits Comparison Table
Using the XBRL API with the Public Filings Database
Unless otherwise agreed to in writing, any and all use of the XBRL API to authenticate and retrieve data from the XBRL US Database of Public Filings implies user consent and agreement with the XBRL US API Agreement. If you are unable to agree to these terms, do not use the XBRL API.
To use the XBRL API outside of Google Sheets, your account needs to be provisioned for OAuth2 access.