How to screen for companies that do not have an ESG score?

How can I adjust my screener search:

screener = f"SCREEN(U(IN(Equity(active,public,primary))/*UNV:Public*/), IN(TR.RegCountryCode,{country}), TR.TRESGScore(Period=FY{i})>0, CURN=USD"

which screens for companies that have an ESG score for a screen only returning companies that do not have an ESG score?

I have tried:

TR.TRESGScore(Period=FY{i})<=0
TR.TRESGScore(Period=FY{i})<0
TR.TRESGScore(Period=FY{i})==<NA>
TR.TRESGScore(Period=FY{i})=='<NA>'

But could not figure out a way to screen for companies NOT having an ESG score. Is there any possibility to do that?

Best Answer

  • Hi @lukas.kleemann ,

    Having a look at this article, and using this python file, I managed to make the following work:

    from dataquery import *
    import refinitiv.data as rd
    try: # The following libraries are not available in Codebook, thus this try loop
    rd.open_session(
    config_name="C:\\Example.DataLibrary.Python-main\\Configuration\\refinitiv-data.config.json",
    name="desktop.workspace")
    except:
    rd.open_session()
    query = SCREEN.express.universe(
    Equity(active=True, public=True, primary=True)) \
    .conditions(IN('TR.RegCountryCode', 'US'), FLOOR('TR.TRESGScore')) \
    .currency('USD').query
    df = rd.get_data(
    query,
    'TR.TotalRevenue')
    df


    Is this what you were after?

    1687003282851.png


    FYI: the syntax object was:
    SCREEN(U(IN(Equity(primary,public,active))),IN(TR.RegCountryCode,US),FLOOR(TR.TRESGScore),CURN=USD)

Answers