How to use eikon's get_data function to get revenue data between a certain sdate and edate

I tried:

import eikon as ek

new_data_df, err = ek.get_data(['AANC.BO'], ['TR.TotalRevenue'], {"Curn": "USD", "SDate": '2024-01-01', "EDate": '2024-11-22', 'Frq': 'D', "Scale":8})

But the data it returns is very strange, there are only two kinds of numbers

Answers

  • Hi @rice ,

    You can add .date after the field name to see the date of each field's data, as below

    import eikon as ek

    new_data_df, err = ek.get_data(['AANC.BO'], ['TR.TotalRevenue.date','TR.TotalRevenue'], {"Curn": "USD", "SDate": '2024-01-01', "EDate": '2024-11-22', 'Frq': 'D', "Scale":8})
    image.png

    Thank you for posting the question inthis forum. However, this forum is dedicated to an API usage question hence,the moderators on this forum do not have deep expertise in every type ofcontent available through our products. Such expertise is available through the Helpdesk, which can be reached via MyAccount

    Hope this helps and please let meknow in case you have any further questions.

  • rice
    rice Newcomer

    so how to use eikon's get_data function to get revenue data between a certain sdate and edate?

    I tried to ask for help in the Helpdesk, but the email reply used the refinitiv.data package. He told me that if I want to know how to use ek.get_data to get data, I need to go to the Developer Community for help.

  • Hi @rice ,

    Is this what you're looking for?

    df, err = ek.get_data(['AANC.BO'],
    ['TR.F.TotRevBizActiv.date','TR.F.TotRevBizActiv.periodenddate','TR.F.TotRevBizActiv'],
    {'SDate':'2024-01-01', 'EDate':'2024-11-22','FRQ':'FI','Period':'FI0'})
    df
    image.png

    The description of the field can be found in Data Item Browser

    image.png
  • rice
    rice Newcomer

    This seems to be the summary data for the quarter. What I want is the data between any sdate and edate. Similar to the following:

    import refinitiv.data as rd

    rd.open_session()

    df = rd.get_data(

        universe = ['AANC.BO'],

        fields = ['TR.TotalReturn(Frq=D,SDate=2023-01-01,EDate=2023-12-31)']

    )

    截屏2024-11-27 16.33.49.png

    In this way, I can add up the data for each day to get the data for a period of time.
    But this uses the refinitive.data package, and I want to get the same data through the eikon package

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    You can use the same instruments and fields with Eikon Data API. For example:

    df, err = ek.get_data(
        ['AANC.BO'],
        ['TR.TotalReturn(Frq=D,SDate=2023-01-01,Edate=2023-12-31)']
    )
    df
    
  • rice
    rice Newcomer

    Thank you for your patient answer. This can indeed get the data, but when I try to get the revenue data, the returned data seems to have some problems. There are only two values.

    截屏2024-11-29 08.56.46.png
  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @rice

    You may need to add dates to check the dates of the data.

    image.png

    I am not sure if the TotalRevenue can be changed daily. You need to contact the helpdesk team via MyAccount to verify it.