Upgrade from Eikon -> Workspace. Learn about programming differences.

For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
18 0 1 3

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

eikoneikon-data-apirefinitiv-dataplatform-eikonworkspaceworkspace-data-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvote
Accepted
10.2k 18 6 9

@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.


1628768583617.png (106.0 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.