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