Headers & date fields

I am trying to replicate this Excel function with the python API

=TR("FB.O";"TR.TotalRevenue";"Period=FQ0 Frq=FQ SDate=0 EDate=-4 RH=date")

I would like to have the same date associated with RH. I guess I would need an extra field, but I can't figure out which one or how to set get_data

ek.get_data(['FB.O'], ["TR.TotalRevenue"], parameters={"SDate": "0", "EDate": "-4", "Period": "FQ0", "Frq": "FQ"})

Output in Excel:

2018-09-30 1,37E+10 2018-06-30 1,32E+10 2018-03-31 1,2E+10 2017-12-31 1,3E+10 2017-09-30 1,03E+10

Thanks

Best Answer

  • Add TR.TotalRevenue.date to the list of fields:

    ek.get_data(['FB.O'], ["TR.TotalRevenue.date","TR.TotalRevenue"], {"SDate": "0", "EDate": "-4", "Period": "FQ0", "Frq": "FQ"})

Answers