question

Upvotes
Accepted
31 7 7 17

Can I use Screener to get a data-frame of Revenue values for companies broken down by sector in Codebook?

Can I use Screener to get a data-frame of Revenue values for companies broken down by sector in Codebook? I tried in Excel and it crashes, presumebly because of the large size of the request.

#technologypython apiscreeningrefinitiv-dataplatform-libraries
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.

Upvotes
Accepted
5.7k 21 2 6

Hi @danieluphromes ,


Yes, you can; please try the below in Codebook and let me know if it works as expected for you:

https://gist.github.com/johnukfr/834233fdd50e1c5c15d635ef034d7bc7


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.

I tested it with


test1 = equityBySubSectorScreen(
    screenOn=[i.strip() for i in
              [' 5010101010', ' 5010101011', ' 5010101012', ' 5010201010',
               ' 5010202010', ' 5010202011', ' 5010202012', ' 5010202013',
               ' 5010202014', ' 5010202015', ' 5010203010', ' 5010203011',
               ' 5010203012', ' 5010203013', ' 5010301010', ' 5010301011', ' 5010301012']])
test1


and


test2 = equityBySubSectorScreen(
    renameCols=False,
    screenOn=[i.strip() for i in
              [' 5010101010', ' 5010101011', ' 5010101012', ' 5010201010',
               ' 5010202010', ' 5010202011', ' 5010202012', ' 5010202013',
               ' 5010202014', ' 5010202015', ' 5010203010', ' 5010203011',
               ' 5010203012', ' 5010203013']])
test2
Upvotes
5.7k 21 2 6

Hi @cyril.blanchard ,

You can choose the fields you want out of the excel sheet with the argument `dataField`. The choice of fields you can request can be found using the DIB. I do this below to output 'equityBySubSectorScreenALL20230201v1.xlsx'


test4 = EquityBySubSectorScreen(
    dataField=["TR.TotalRevenue", "TR.NetDebt", "TR.EBITDA", "TR.CapitalExpenditures"],
    sectorFieldNames=[
        "TR.TRBCEconomicSector", "TR.TRBCBusinessSector",
        "TR.TRBCIndustryGroup", "TR.TRBCIndustry",
        "TR.GICSIndustry", "TR.GICSIndustryGroup",
        "TR.TRBCActivity", "TR.TRBCActivityCode"])
test1.to_excel("EquityBySubSectorScreenALLv1.xlsx")
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.

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.