Calculating ratio of each geographic segment revenue to total revenue (geographic Herfindahl index)

Hi All, just find a little problematic to calculate the ratio of each geographic segment revenue to the total revenue for a instrument. While I am able to retrieve all geographic segment revenue data by TR.BGS.GeoTotalRevenue, I am thinking to code (by Python/R/Excel) to divide each geographic segment revenue by total revenue directly. The manual calculation is relatively time consuming. I appreciate your generosity of sharing any suggestions and thoughts. Many thanks. Jason

Best Answer

  • @J.Wang2 try this:

    df,err = ek.get_data('VOD.L',['TR.BGS.GeoTotalRevenue.segmentName','TR.BGS.GeoTotalRevenue'])

    df['Rev_pct'] = (df['Geographic Total Revenues (Calculated)']/df['Geographic Total Revenues (Calculated)'].iloc[-1])*100

    df

    1628768583617.png

    I don't think it can be simplified further than this.

Answers

  • @jason.ramchandani Many thanks. that is helpful, but It seems to still require manual processing. Unfortunately, Eikon doesn't provide individual segment revenue separately.

    Much appreciated.