Retrieve normalized company data (e.g. revenue) form foreign currency to EUR by the average exchange

Retrieve normalized company data (e.g. revenue) form foreign currency to EUR by the average exchange rate of the regarded period?
Tagged:

Best Answer

  • raksina.samasiri
    Answer ✓

    Hi @maes.michel ,

    Thank you for your patience, you can use the field named TR.F.TotRevenue, which does offer period average FX rate option for currency conversion.

    ek.get_data('IBM.N',['TR.F.TotRevenue.date','TR.F.TotRevenue'], {'SDate':'2021-09-08','Period':'FY0','Curn':'EUR', 'FXRate':'PeriodAvg'})

    @Alex Putkov.1, thank you for an advice.

Answers

  • Hi @maes.michel ,

    Data Item Browser can help you to know proper parameter that can be used in each field (Data Item). You may follow these steps (here's the screenshot of DIB eikon-revenue-01.jpg)

    1. search for 'DIB' or 'Data Item Browser' in the Eikon desktop search box.
    2. input instruments (I put AAPL.O here for an example)
    3. search for the Data Item (field)
    4. Then in the right section of DIB, click on 'Parameters' tab
      1. tick 'Series' option to get the data in period of time, here I set as Last 2 Fiscal years
      2. set Currency to 'EUR'
      3. the Eikon Excel formula is generated, click on the copy button on the bottom right of DIB, you'll get the formula below
        TR.Revenue(SDate=0,EDate=-1,Period=FY0,Frq=FY,Curn=EUR)
    5. which can be converted to Python code as below (I added 'TR.Revenue.date' to see the date of the data)
      df, err = ek.get_data(instruments = ['AAPL.O']
      , fields = ['TR.Revenue', 'TR.Revenue.date']
      , parameters = {'SDate':'0', 'EDate':'-1','Period':'FY0','Frq':'FY','Curn':'EUR'})
      display(df)

    here's the output

    eikon-revenue-output.jpg

    hope this could help

  • Dear Raksina,

    Thanks for the reply, but I have a different issue. I frequently use the DIB, but it does not say how to handle currency conversion by the average FX-rate over the entire period(just like in the desktop)

    So if the the revenue is quarterly based, I'd like to convert the data by the average and not the closing or cross-rate of that period.

    The folowing command will give me the currency conversion by the latest date:

    TR.RevenueActValue(SDate=2021-09-08,Period=FY0,Curn=EUR, FXRateEst=Latest)

    What parameter is needed to convert to the average FX-Rate of a period?

    FXRateEst=????

    Kind regards,

    Michel






  • Hi @maes.michel ,

    Thank you for your patient, The only two options DIB offers for FXRateEst parameter are "Latest" and "PeriodEnd". There's no option to use the average FX rate for currency conversion.1634220886387.png

    However, according to the answer in this thread, you might get the average FX rates using this code and use it to convert.

    df, err = ek.get_data('CNY=', 
    'AVG(TR.FxRateComposite(Sdate=20190101,Edate=20191231))')
    avg_usd_to_cny = df.iloc[0,1]
    avg_cny_to_usd = 1/df.iloc[0,1]

    So for example, to convert the revenue rate from CNY to EUR, you may get the rate of revenue in CNY and multiply it by avg_cny_to_usd and avg_usd_to_eur

  • Hi Raksina,

    This is exactly, what I was looking for! Thx!