How to get most recent value if the value not available for a specific date?

Hello. When using EIKON DATA API get_data() to retrieve a field such as TR.DividendYield for a specific date say 2019-08-31, the data is not available for some stocks on that specific date but is available for an earlier date say 2019-08-30. Is there any query parameter I can add to make get_data() return any most recent data without me issue another query for that earlier date? Thank you.

Best Answer

  • chavalit-jintamalit
    Answer ✓

    Hi @YC

    There is no parameters to fill the "NaN" data with the earliest available data point.

    image


    I suggest that you can retrieve data in range and if the data point on the specific date is not available, you can look back to the earliest available data point.


Answers

  • Hello @YC

    As far as I understand, if the date is not specified, the most resent value of TR.DividendYield will be returned. For example:

    df, err = ek.get_data('IBM.N', ['TR.DividendYield'])
    df

    Result:

    image


  • Hi Chavalit, thank you so much for your reply and suggestion.