Obtain TR.CommonName and TR.RIC given a list of companies

I have a list of 1752 private company names. I would like to ask how to extract TR.CommonName and TR.RIC for all of the 1752 companies.

I use the following code to obtain TR.CommonName and TR.RIC for Jetstar

df, err = ek.get_data([SCREEN(U(IN(Private(OrgType(COM,UNK,MKP)))),Contains(TR.CommonName, Jetstar))], [TR.CommonName,TR.RIC])

when I try to apply the code to a list of company names like following, I notice that eikon search for companies with names that contains the character "company_list [x]", instead of the value that company_list [x] refers to.

for x in company_list[0,1751]

df_1 = df

df_2, err = ek.get_data(['SCREEN(U(IN(Private(OrgType(COM,UNK,MKP)))),Contains(TR.CommonName,company_list [x]))'], ['TR.CommonName','TR.RIC'])

df_2["MerchantName"] = company_list [x]

df_merged = pd.concat([df_1,df_2],ignore_index = True)

df = df_merged


Thank you very much.

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @songqirong

    Do you mean the Eikon Screener search for the company with "company_list[x]" string instead of the value of the company_list[x] variable?

    If so, you need to concat the actual value of the company_list[x] variable to the Screener query string.

    for x in company_list:
        screen = 'SCREEN(U(IN(Private(OrgType(COM,UNK,MKP)))),Contains(TR.CommonName, {})'.format(x)
        print(screen)

    concat-string-screener.png


    You can find more details from the following Python resources: