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.'

Best Answer

  • raksina.samasiri
    Answer ✓

    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

Answers

  • 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


  • 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

  • Thanks that clarifies a lot. the error message is quite confusing but now I understand it. Thanks a lot!