question

Upvotes
Accepted
43 7 7 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.

Hello @charles.malafosse,

Thank you for your participation in the forum.

Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

-AHS

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

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

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.