Export Query in advanced Search

To add Return on Investment (ROI) or Earnings Before Interest and Taxes (EBIT) in Advanced Search, follow these steps:
1. Open Advanced Search.
2. Select a universe (e.g., Equities).
3. In the Results panel, click "Add Additional Fields".
4. In the Data Item Library, select a category (e.g., Financials) and choose the desired field (e.g., ROI or EBIT).
These fields will be added as temporary columns to your search results table.
If I follow these steps, there is nothing added in the export query. If I add another column like Revenue USD, it's also selected in the export query (code).
How can I access these additional Fields in the export query?
Answers
-
Hi @Midas ,
Sorry for an inconvenient, this is the behavior of Export Query in Advanced Search application that the selected fields will not be exported along with filters (However, our product team also would like to make it export selected fields in the future, will keep you updated)
As an alternative, from the output of Search function, RICs list can be used to retrieve the data with get_data() function. Fields or Data Item name can be found in CodeCreator application inside Workspace.
The code below can be used
import lseg.data as ld
ld.open_session() search_df = ld.discovery.search(
view = xxxxxx
,
filter = "xxxxxx",
select = "xxxxxx"
) rics_list = search_df['RIC'].to_list()
df = ld.get_data(
universe = rics_list,
fields = [
'TR.PCReturnOnInvestedCapPct',
'TR.EBITMean'
]
)
display(df)0 -
import lseg.data as ld
ld.open_session()
Perform a free-text search for instruments related to the "Consumer Discretionary" sector
search_df = ld.discovery.search(
view="EquityQuotes", # Use the EquityQuotes view to get quote-level data
query="Consumer Discretionary", # Search for the term "Consumer Discretionary"
select="RIC" # Retrieve only the RICs (Reuters Instrument Codes)
)#Extract a clean list of unique RICs (instrument identifiers)
rics_list = search_df['RIC'].dropna().unique().tolist()
#Request EBIT estimate data (mean) for the identified instruments
df = ld.get_data(
universe=rics_list, # The list of instruments to request data for
fields=['TR.EBITMean'] # Request the TR.EBITMean field (mean EBIT estimate)
)#Remove entries where EBIT is missing or not available
df = df[df['TR.EBITMean'].notna()]
#Calculate the average EBIT across all valid instruments
average_ebit = df['TR.EBITMean'].mean()
#Print the final result
print("Average EBIT in the Consumer Discretionary sector:", average_ebit)
this is what I am aiming for… so the problem with your idea is, filtering out all the data. It was easily possible with advanced search but there was the error with the export query. Can you tell me what to do to access the necessary data for those average calculations?
Thanks0 -
The correct one could be:
df = ld.discovery.search( view = ld.discovery.Views.EQUITY_QUOTES, filter = "Gics eq 'Consumer Discretionary'", select="RIC,Gics", top = 10000 ) df
However, although approximately 168,297 entries match the filter, the search API can return only up to 10,000 entries.
0 -
- The screen returns more than 5,000 results, please add more filters.
the screener is limited to 5000
0 -
Hi @Midas ,
Example of how to deal with Upper limit can be found in
- Section 2) Using the Search function to retrieve the data in Searching for KungFu Bonds (Chinese-issued U.S. dollars bonds) with the Data Library - Search function | Devportal
- Limit section of article Building Search into your Application Workflow.
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 37 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 697 Datastream
- 1.5K DSS
- 632 Eikon COM
- 5.2K Eikon Data APIs
- 14 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 6 Trading API
- 2.9K Elektron
- 1.5K EMA
- 256 ETA
- 563 WebSocket API
- 39 FX Venues
- 15 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 283 Open PermID
- 47 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 764 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 27 DACS Station
- 122 Open DACS
- 1.1K RFA
- 107 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 98 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛