question

Upvotes
Accepted
1 2 3 2

rdp.search with conditions

Hi everyone, I would have a question about a search using Eikon API. I am crating a peer group to analyze bonds. The code I am using now is: GroupSize= 20 basestring = "DerivedCategory eq '" + currentInstrumentData['DerivedCategory'][ 0] + "' and " + "OriginalIssueCurrency eq '" + currentInstrumentData['OriginalIssueCurrency'][ 0] + "' and " \ + "ParentIndustrySector eq '" + currentInstrumentData['ParentIndustrySector'][ 0] srchfields = "RIC,ISIN,SeniorityType,NativeIdentifier peergroupData = rdp.search(view=rdp.SearchViews.GovCorpInstruments, filter=basestring, top=GroupSize, select=srchfields) being said that it works perfectly so far, sometimes I get peers with empty RIC or empty NativeIdentifier and this clock the rest of my code. Is it possible tosearh fr peers using the forementioned method but excluding peers with empty RIC and NativeIdentifier during the search itself? thank you
rdp-apirefinitiv-data-platformrefinitiv-data-platform-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.

1 Answer

· Write an Answer
Upvotes
Accepted
18.2k 21 13 21

Hi @tanja.baccega

You can add more condition to your search filter

Here is the sample but you can add more condition to fit your needs:

GroupSize= 5
basestring = "DerivedCategory eq 'BOND' and OriginalIssueCurrency eq 'USD' and ParentIndustrySector eq 'BANKS' and RIC ne null and ISIN ne null"
srchfields = "RIC,ISIN,SeniorityType,NativeIdentifier,DerivedCategory,OriginalIssueCurrency,ParentIndustrySector"
peergroupData = rdp.search(view=rdp.SearchViews.GovCorpInstruments, filter=basestring, top=GroupSize, select=srchfields)
peergroupData


"RIC ne null" means "RIC field does not equal NULL value".


ahs.png (72.8 KiB)
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.