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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
40 1 3 2

Load sales geographical split for a list of companies

Hello,

The below formulas on excel give me the split of sales by country for a chosen company that has published financials. I would like to do that for a list of companies, via the Python API.

10873-image.png

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
image.png (42.0 KiB)
icon clock
10 |1500

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

1 Answer

Upvotes
Accepted
38.1k 71 35 53

@emmanuel.chaslin

The code should like this:

 df,err = ek.get_data(["PEP.O","IBM.N"],
                       [
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY0).segmentName",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY0).periodEndDate",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY0)",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-1).segmentName",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-1).periodEndDate",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-1)",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-2).segmentName",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-2).periodEndDate",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-2)",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-3).segmentName",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-3).periodEndDate",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-3)",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-4).segmentName",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-4).periodEndDate",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-4)",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-5).segmentName",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-5).periodEndDate",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-5)",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-6).segmentName",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-6).periodEndDate",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-6)",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-7).segmentName",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-7).periodEndDate",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-7)",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-8).segmentName",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-8).periodEndDate",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-8)",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-9).segmentName",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-9).periodEndDate",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-9)",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-10).segmentName",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-10).periodEndDate",
                           "TR.BGS.GeoExternalRevenue(Scale=6,Period=FY-10)"               
                              
                       ]
                      )
 df

The output is:

10874-image.png


image.png (87.8 KiB)
icon clock
10 |1500

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

Click below to post an Idea Post Idea