Screening using name contains

exp =  "SCREEN(U(IN(Equity(active,public,primary))), IN(TR.ExchangeCountryCode,CA), CURN=CAD)"


exp = "SCREEN(U(IN(Equity(active,public,private,primary))), Contains(TR.CommonName,%s), CURN=CAD)" %name


fields = ["TR.CompanyName"]


df,e = ek.get_data(exp, fields)

The first exp works, but the second one does not. How is the "Contains" argument supposed to be used?

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @dshi

    The name should in double quotes. I have tried this one and it works.

    name = '"Business"'
    exp = 'SCREEN(U(IN(Equity(active,public,private,primary))), Contains(TR.CommonName,%s), CURN=CAD)' %name
    fields = ["TR.CompanyName"]
    df,e = ek.get_data(exp, fields)
    print (df)

Answers