Eikon API: how to add dates to output of 'get_data'?

Question on behalf of a client: how to add the dates (as index) to the output of the following code?

start_date = str(20170801)
end_date = str(20170901)

data, err = eikon.get_data("ACCG.AS", ["TR.PriceTargetMean", "TR.PEG"], parameters= {"SDate":start_date, "EDate":end_date})

Thank you so much in advance for your help!

Best Answer

  • You can add date output to either one or both of these fields by adding the field with .date qualifier. E.g. eikon.get_data("ACCG.AS", ["TR.PriceTargetMean.date", "TR.PriceTargetMean", "TR.PEG"], {"SDate":start_date, "EDate":end_date})

    Note that if there's a possibility that the dates for TR.PriceTargetMean and TR.PEG do not align due to gaps in data or some such, you need to request dates for these two fields separately: eikon.get_data("ACCG.AS", ["TR.PriceTargetMean.date", "TR.PriceTargetMean", "TR.PEG.date", "TR.PEG"], {"SDate":start_date, "EDate":end_date})
    We're working on an enhancement to introduce master date output column similar to what RH:Date parameter does for =TR function in Eikon Excel.

Answers

  • @Alex Putkov Thank you for your reply and good to know you are working on an enhancement similar to RH:Date for excel.

    The issue with adding "TR.PriceTargetMean.date" is that it only adds the latest known date of a price target update and not the specific dates in between, so using this function still does not solve my issue of finding the price target for all dates between start_date and end_date.

  • Try TR.PriceTargetMean.calcdate instead then.

  • Great! That's exactly what I needed!

  • Dear Alex Putkov,

    you mentioned "We're working on an enhancement to introduce master date output column similar to what RH:Date parameter does for =TR function in Eikon Excel".

    Do you have any update on this? This functionality would be very useful.

    Thank you,

    Bettina

  • hi @Bettina.DeRuyck ,

    Currently, you can use Data Item Browser (DIB) in Refinitiv Workspace/Eikon desktop app to get the available date parameter of each field

    To access DIB, type DIB in the Eikon search bar. Then you can search for the field name, its description, and available parameters are shown at the right section of the app. Please see an example screenshot below

    1646882962336.png

    Here's the Data Item Browser training video

    However, as far as I know, the master date output column similar to what RH:Date parameter does for =TR function in Eikon Excel isn't available yet. and DIB only provides the date of each field.

    Hope this could help

    Plus, please be informed that the closed thread (question with an accepted answer) won't be monitored, so in case you'd like to raise a question, please create a new question and you may mention the reference question in the post as well.