Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

avatar image
Question by Erik77 · Nov 20, 2020 at 10:08 AM · eikoneikon-data-apiworkspacepythonworkspace-data-apirefinitiv-dataplatform-eikonhistoricalesg

Historical ESG Data - Unexpected output for a particular data point

Dear developer community,

I am pulling 10 year historical ESG Data on a number of data points. I use the same code for all the requests, and just replace the Eikon Code. However, when it comes to a specific datapoint, I get an unexpected output. See below:

Here is an example where I successfully output the historical data of another ESG datapoint:

ISIN_appended_df = []

for sublist in chunklist:

data7, err =ek.get_data(sublist, fields=["TR.EmissionReductionTargetPctage(SDate=0,EDate=-10,Period=FY0,Frq=FY).date","TR.EmissionReductionTargetPctage(SDate=0,EDate=-10,Period=FY0,Frq=FY)"],parameters=None, field_name=False, raw_output=False, debug=False)

ISIN_appended_df.append(data7)


ISIN_appended_df = pd.concat(ISIN_appended_df)

Result:

Here is the example where the same code fails to produce the expected outcome:

HSMS_df = []

for sublist in chunklist:

data7, err =ek.get_data(sublist, fields=["TR.HSMSCertifiedPctage(SDate=0,EDate=-5,Period=FY0,Frq=FY).date","TR.HSMSCertifiedPctage(SDate=0,EDate=-5,Period=FY0,Frq=FY)"],parameters=None, field_name=False, raw_output=False, debug=False)

HSMS_df.append(data7)


HSMS_df = pd.concat(HSMS_df)

Result:

As you can see, the column names do not have the expected titles, and there is no data outputted for any of the firms.

Thanks in advance

screen-shot-2020-11-20-at-110010.png (110.9 KiB)
screen-shot-2020-11-20-at-110225.png (100.6 KiB)

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by jason.ramchandani01 · Nov 20, 2020 at 05:02 PM

Hi @Erik77 - I can replicate the issue - the reason is that the second set of fields is not applicable (or we have no data for the company mentioned) - we can check this by looking at the Data Item Browser app (type DIB into Eikon search bar) - if we look for the field without an instrument we can see the field exists, but if we look for the field with one of the instruments you used say ISIN:DK0010244508 which is AP Moeller we see the field is not available:

So the way to figure out if this is an error or not is to look at the second err object to see if it returned anything - for a good and complete API call it will be empty:

data7, err =ek.get_data('DK0010244508', fields=["TR.EmissionReductionTargetPctage(SDate=0,EDate=-10,Period=FY0,Frq=FY).date","TR.EmissionReductionTargetPctage(SDate=0,EDate=-10,Period=FY0,Frq=FY)"],parameters=None, field_name=False, raw_output=False, debug=False) 

err

For an erroneous call it will be populated as it is for the second of your calls:

data7, err =ek.get_data('DK0010244508', fields=["TR.HSMSCertifiedPctage.date","TR.HSMSCertifiedPctage"],parameters={'SDate':'0','EDate':'-5','Period':'FY0','Frq':'FY'},raw_output=False) 

err

So a simple test like the following would take care of this:

if err:     
   #dont append and note error and ISIN     
   print('error') 
elif len(data7):         
   #append         
   print('good return')

I hope this can help.


1605888836941.png (129.4 KiB)
1605891045752.png (67.3 KiB)
Comment
Erik77

People who like this

1 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

avatar image
Erik77 · Nov 24, 2020 at 02:34 PM 0
Share

Thank you for your answer @jason.ramchandani. To be clear, you would add the suggested code inside the for loop correct? Where the append takes place? Please demonstrate inside the forloop if more helpful for explaining.

HSMS_df = []

for sublist in chunklist:

data7, err =ek.get_data(sublist, fields=["TR.HSMSCertifiedPctage(SDate=0,EDate=-5,Period=FY0,Frq=FY).date","TR.HSMSCertifiedPctage(SDate=0,EDate=-5,Period=FY0,Frq=FY)"],parameters=None, field_name=False, raw_output=False, debug=False)

HSMS_df.append(data7)


HSMS_df = pd.concat(HSMS_df)


Moreover, do we know why the field is not available for some companies? If I understand your reply correctly, under "regular" circumstances, fields are available for all companies in the universe, and if data is not available, the value returned is simply NaN. However, for TR.HSMSCertifiedPctage, do I understand correctly that the field e.g. the column itself, is not available for some companies all together? Why is this so?


Thanks in advance!

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
10 People are following this question.

Related Questions

How can I get historical ESG data?

Trying to fetch Close Bid Price for CMO tranche from Python

get_data to fetch history of fx values

Exporting weather data to CSV

list of bankrupt companies & balance sheet/ income statements of a specific year

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges