Cannot translate a Datastream excel formula to a python PyDSWS

Hello,

I am trying to get the sector for each S&P constituents historically (GICS or TRBC) using the Datastream python API. So far I can only get back N/A.

I asked the help desk to provide an excel formula to download sector :

They gave me the following but it does not even work on my excel. Potentially I do not have access to gics.

=DSGRID('GICS Sector Code'!$A$3:$A$30,"X(MSCISC)","2019-01-01","","","Sym=RIC","")

For this reason I tried with TRBC and created the following formula:

=DSGRID("LS&PCOMP0619","P,PE,MV,NAME,RIC,ISOCUR,TR1,TR1N,TR2,TR2N,TR3,TR3N,TR4,TR4N","2019-06-30","","","")

THis works in excel but impossible to translate that in pyDSWS. THe following line returns values for classic fields but nothing for sectors;

ds.get_data(tickers="LS&PCOMP0619", fields='P,PE,MV,NAME,RIC,ISOCUR,TR1,TR1N,TR2,TR2N,TR3,TR3N,TR4,TR4N', date ="2019-06-30")

Could someone please advise. These data issues are a nightmare to deal with.

THanks

Best Answer

  • James.Bright1
    Answer ✓

    Hi, this is a permissioning issue and you should speak with your account manager to have the correct entitlement added to your account.

Answers

  • Hi Charles,

    The request is returning data - just the layout is not practical. Not entirely sure what you are not able to retrieve. Can you include a screenshot as well?

    Kind regards,

    Nicole

  • Hi Nicole,

    Here is a screenshot. As you can see I get data for price and other fields, except for TRXX codes. However these fields return values in the excel formula.

    Thanks for helping.

    image

  • Hi. No this is not satisfactory in resolving my query and I did post further insight. Awaiting an answer from Nicole. Thanks