Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
13 5 4 7

Screener formula does not work in Eikon API

I am trying to use the same formula than Excel is retrieving me in Python and it is not working.

=TR("SCREEN(U(IN(Private(OrgType(COM, UNK, MKP)))/*UNV:Private*/), IN(TR.TRBCActivityCode,""5430102016""), IN(TR.HeadquartersRegion,""Europe""), BETWEEN(ZAV(TR.PCSmartRatiosLiquidityGlobalRank), 1.00, 20.00), CURN=USD)","TR.CommonName;TR.TRBCActivity"&";TR.HeadquartersRegion;ZAV(TR.PCSmartRatiosLiquidityGlobalRank)","curn=USD RH=In CH=Fd")



eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apieikon-com-apiscreener
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
22.1k 59 14 21

Hi @miriam.benito, Can you try this and see if it works for you:

exp = "SCREEN(U(IN(Private(OrgType(COM, UNK, MKP)))), IN(TR.TRBCActivityCode,""5430102016""), IN(TR.HeadquartersRegion,""Europe""), BETWEEN(ZAV(TR.PCSmartRatiosLiquidityGlobalRank), 1.00, 20.00), CURN=USD)" fields = ['TR.COmmonName', 'TR.TRBCActivity', 'TR.HeadquartersRegion', 'ZAV(TR.PCSmartRatiosLiquidityGlobalRank)'] 

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

print(df)

Here is my output:

     Instrument  ... ZAV(TR.PCSmartRatiosLiquidityGlobalRank)
0 4298157373 ... 9
1 4298203137 ... 18
2 4298232673 ... 14
3 4298253815 ... 14
4 4298266156 ... 14
5 4298270206 ... 3
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.

Hi @Gurpreet.

I do not know why I cannot run the same command...

Upvotes
22.1k 59 14 21

@miriam.benito Can you post your instrument list and complete script. I tried it with few instruments and the formula worked ok.

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.

@Gurpreet. Thanks for your response. I think that the question is wrongly posed. I wanted to retrieve the private companies of the activity with the code 5430102016 (Food markets) with those filters. There is no more than 5000 companies with those filters (already checked it via Screener), hence, I do not have the instrument list I want that list :)

The code is:

exp = "SCREEN(U(IN(Private(OrgType(COM, UNK, MKP)))/*UNV:Private*/), IN(TR.TRBCActivityCode,""5430102016""), IN(TR.HeadquartersRegion,""Europe""), BETWEEN(ZAV(TR.PCSmartRatiosLiquidityGlobalRank), 1.00, 20.00), CURN=USD)"

ek.get_data(instruments=[exp], fields=["TR.CommonName","TR.TRBCActivity","TR.HeadquartersRegion","TR.PCSmartRatiosLiquidityGlobalRank"])

Thanks a lot!

Upvotes
22.1k 59 14 21

Hi @miriam.benito Can you please confirm that you are using the latest version of Eikon API ?

>>> import eikon as ek
>>> ek.__version__
'1.0.1'
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.

Hi @Gurpreet.,

It was the version.. thank you for the point!

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.