On Excel I use DSGRID("S&PCOMP";"afcmn2019;afcmn2020;afcmn2021;afcmn2022") and
DSGRID("msbrazl";"afcmn2019;afcmn2020;afcmn2021;afcmn2022"). How to query on python using ek.get_data?
This data comes from Datastream Web Service. To retrieve it you need to use DatastreamDSWS library. For documentation see Getting Started Guide. You may also want to check out the video titled Build Financial Models in Python using Datastream Web Service.Here's the code snippet that retrieves the data you're interested in
import DatastreamDSWS as dswsds = dsws.Datastream(username='my_username', password='my_password')ds.get_data (tickers='S&PCOMP, MSBRAZL', fields=['AFCMN2019','AFCMN2020','AFCMN2021','AFCMN2022'])