question

Upvotes
Accepted
43 6 6 6

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

datastream-apidsws-api
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
681 2 2 1

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

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

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

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
43 6 6 6

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.


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.