Home › Forums › The XBRL API › How to gracefully handle duplicate values
- This topic has 1 reply, 2 voices, and was last updated 2 years, 8 months ago by David Tauriello.
-
AuthorPosts
-
-
Sunday, March 12, 2023 at 10:02 PM #209309Jeff KrimmelParticipant
Hi,
Here’s an example of a query that returns 32 instances of a repeated value:
I’m interested in the one that has dimension.local-name=”ProductOrServiceAxis” and member.local-name=”OilAndGasExcludingPurchasedMember”. Even then, I have 8 instances of this particular combination.
Is there a way to gracefully extract just a single instance of the value I need?
Thanks a bunch.
-
Monday, March 13, 2023 at 8:35 AM #209323David TaurielloKeymaster
Hi Jeff – the 303000000 values are not identical; one is for the US and one is Egypt, so the only way to show one of these facts is to add fact.limit(1) to the fields. Depending on how you structure the query, you may get a different fact (US or Egypt).
Here’s the entire OilReservesMember ‘story’ – I’ve sorted by fact.value so you can see US and Egypt easily:
https://api.xbrl.us/api/v1/fact/search?report.document-type=10-K,10-Q,1&entity.code=0001841666&period.fiscal-year=2020&period.fiscal-period=3Q&concept.local-name=RevenuesFromCustomersAndNonCustomers&member.local-name=OilReservesMember&fields=concept.local-name,fact.value.sort(ASC),report.id,report.sec-url,dimension-pairAt this level, you’ll need to rely on your application to filter out the unwanted results, or specify additional an additional filter on the fact (fact.id, fact.xml-id, fact.hash) so you get the exact fact you intend.
The report.sec-url is included in the results for this query, so you can open the inline filing, enter ‘303’ (no quotes) in the search and see these facts in the report.
-
-
AuthorPosts
- You must be logged in to reply to this topic.
Search Forums
Recent Topics
- Income Statement data for a company by David Tauriello
- Normalized data presentation by David Tauriello
- Extract Director RSUs/Options Form 14A by Priyanka Goonetilleke
- Using the offset parameter by David Tauriello
- Spreadsheet Commands: Query Worksheet and Query Workbook Query Workbook by Liam Noailles
Recent Replies
-
Income Statement data for a company 5 months, 2 weeks ago
-
Income Statement data for a company 5 months, 2 weeks ago
-
Using the offset parameter 9 months, 3 weeks ago
-
Using the offset parameter 9 months, 3 weeks ago
-
Using the offset parameter 9 months, 3 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.





