question

Upvotes
Accepted
77 5 12 17

starmine data available in excel but gives strange warning in code book

In Excel when asking for the starmine rank I don't need to supply any additional parameters.
In Codebook it ask me to supply fields or functions I don't understand in the first place why I need to supply additional information and second it is not clear to me what I need to supply then.

Please help me solve this!

See the comparison Python and Excel below:


Excel:

=TR("NVDA.O","TR.IVPriceToIntrinsicValueGlobalRank","CH=Fd RH=IN",B2)

see below also that the expected result is returned

1708546570353.png

CODEBOOK (Eikon):

import refinitiv.data as rd

rd.open_session()
print(rd.__version__)
print("-----------")

fields = ["TR.IVPriceTolntrinsicValueGlobalRank"]

EikonData = rd.eikon.get_data(instruments= "AAPL.O", fields= fields)
print(EikonData)

1708548214018.png

I get the following confusing error message:

'The formula must contain at least one field or function.'
#productexcelfieldscodebookstarmine
1708546570353.png (25.8 KiB)
1708548214018.png (139.3 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.

Upvote
Accepted
14.2k 30 5 10

Hi @laurens ,

The field2 value seems to contain a typo, it's a lower L instead of capital I, can you try correct it and run the code again

1708576035561.png

I tried and it works properly

1708576098619.png


1708576035561.png (5.9 KiB)
1708576098619.png (23.7 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.

Thanks that clarifies a lot. the error message is quite confusing but now I understand it. Thanks a lot!
Upvotes
17.4k 82 39 63

Hi @laurens

I tried the above code segment within CodeBook without any issues. Can you try this:

rd.get_data(["AAPL.O", "NVDA.O"], ["TR.IVPriceToIntrinsicValueGlobalRank"])

1708552229501.png



1708552229501.png (12.9 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.

Upvotes
77 5 12 17

Thanks for the response, I am still a bit puzzled why this code gives

import refinitiv.data as rd

rd.open_session()
print(rd.__version__)
print("-----------")

fields2 = ["TR.IVPriceTolntrinsicValueGlobalRank"]

test = rd.get_data(["AAPL.O"], ["TR.IVPriceToIntrinsicValueGlobalRank"])
print(test)
print("-----------")
EikonData = rd.eikon.get_data(instruments= "AAPL.O", fields= fields2)
print(EikonData)
print("-----------")
RD_Data = rd.get_data(["AAPL.O"], fields2)
print(RD_Data)

different results, what am I doing wrong here?

1708553922990.png


1708553922990.png (122.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.