Upgrade from Eikon -> Workspace. Learn about programming differences.
For a deeper look into our Eikon Data API, look into:
Overview | Quickstart | Documentation | Downloads | Tutorials | Articles
Hello @Atul.Sanwal
Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?
If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.
Thanks,
AHS
Hi,
Please be informed that a reply has been verified as correct in answering the question, and marked as such.
Thanks,
AHS
Hi @Atul.Sanwal ,
Could you please confirm which product would you like to use?
import pandas as pd import refinitiv.dataplatform.eikon as ek ek.set_app_key('DEFAULT_CODE_BOOK_APP_KEY')
def getUnderlying(baseRic): LONGNEXTLR = baseRic #For LONGLING1 to LONGLINK15 and LONGNEXTLR fields fields = ['LONGLINK{}'.format(x) for x in range(1, 15)] fields.append('LONGNEXTLR') all_underlying_rics = [] #if LONGNEXTLR is not empty, try to retrieve the data fields while LONGNEXTLR!='': df,e = ek.get_data(LONGNEXTLR,fields) LONGNEXTLR = df.iloc[0]['LONGNEXTLR'] if pd.notnull(df.iloc[0]['LONGNEXTLR']) else '' #If LONGLINK<x> field is not null, append its value to all_underlying_rics list for x in range(1, 15): currentField = 'LONGLINK{}'.format(x) all_underlying_rics.append(df.iloc[0][currentField]) if pd.notnull(df.iloc[0][currentField]) else None return all_underlying_rics
rics_list = getUnderlying('GBRPIZILS=') ek.get_timeseries(rics_list)
Please let me know in case you have any questions.