Home › Forums › The XBRL API › Query for multiple dimensions
- This topic has 2 replies, 2 voices, and was last updated 3 months, 1 week ago by Jeff Krimmel.
-
AuthorPosts
-
-
Thursday, August 22, 2024 at 12:15 PM #219906Jeff KrimmelParticipant
Hi,
Here’s what I’m querying for:
*entity.code 0001035002
*fact.ultimus TRUE
*fact.has-dimensions TRUE
*fact.is-extended TRUE
*dimension.local-name StatementBusinessSegmentsAxis
*member.local-name RenewableDieselMember
*concept.local-name RevenueFromContractWithCustomerIncludingAssessedTax
*dimensions.count 2
*period.year 2024
*period.calendar-period 2QI get four results from this query, each with different fact.value values:
*630000000
*1184000000
*540000000
*14000000The other dimension for each of these results is identical:
*dimension.local-name ConsolidationItemsAxis
*member.local-name OperatingSegmentsMemberSaid differently, each of these four entries has the same dimension-pair values.
In reality, these four values are different in the following way:
* 630000000 – this is the intersegment revenue for Valero’s Renewable Diesel segment
* 1184000000 – this is the total revenue for Valero’s Renewable Diesel segment
* 540000000 – this is the revenue from external customers for just “renewable diesel” within Valero’s Renewable Diesel segment
* 14000000 – this is the revenue from external customers for just “renewable naphtha” within Valero’s Renewable Diesel segmentWhat we’re missing here is 554000000, which is the reported revenue from external customers for the entirety of Valero’s Renewable Diesel segment (the above “renewable diesel” plus “renewable naphtha” values).
Short version of my question – what can I do in my query to only pull in the 1184000000?
They seem to all have the same values for any of the fields I can query against, and I’m struggling to see how I can separate these facts from each other via the query.
Thanks in advance for any help you can offer.
-
Friday, August 23, 2024 at 7:58 AM #219907David TaurielloKeymaster
Hi Jeff – thanks for writing. Try this query (dropping the dimensions.count filter and including dimension-pair as a field in the return):
https://api.xbrl.us/api/v1/fact/search?entity.code=0001035002&period.fiscal-year=2024&period.fiscal-period=2Q&concept.local-name=RevenueFromContractWithCustomerIncludingAssessedTax&fact.ultimus=true&fields=concept.local-name,dimension-pair,dimensions.count,entity.name,fact.value,period.fiscal-period,period.fiscal-year&dimension.local-name=StatementBusinessSegmentsAxis&member.local-name=RenewableDieselMember
There are 5 values, including the totaled RenewableDieselMember as a business segment. Dimensionalized values are the pieces of a total; the total is not included in the dimension.
Apply that concept to the value you’re looking for and you can see it’s on the ConsolidationItemsAxis as an OperatingSegmentsMember in the query. Update to this query and you’ll see the value as a member on the StatementBusinessSegmentsAxis:
https://api.xbrl.us/api/v1/fact/search?entity.code=0001035002&period.fiscal-year=2024&period.fiscal-period=2Q&concept.local-name=RevenueFromContractWithCustomerIncludingAssessedTax&fact.ultimus=true&fields=concept.local-name,dimension-pair,dimensions.count,entity.name,fact.value,period.fiscal-period,period.fiscal-year&dimension.local-name=ConsolidationItemsAxis&member.local-name=OperatingSegmentsMember
I hope this helps.
-
Monday, August 26, 2024 at 3:24 PM #219951Jeff KrimmelParticipant
David,
That’s fantastic. You’re the best.
And that was my confusion, about the totals not showing up in the dimension. That definitely helps me organize this idea more clearly in my head.
Thanks for all that you do around here. You’re a huge help.
All the best,
Jeff
-
-
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, 1 week ago
-
Query for multiple dimensions 3 months, 1 week ago
-
Query for multiple dimensions 3 months, 2 weeks ago
-
Showdata function 6 months ago
-
Showdata function 6 months 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.