question

Upvotes
Accepted
0 0 1 1

How do I retrieve data type Y% for GDP in Datastream via Python?

Hi,

Consider the following RIC in Datastream Web Services: "aBRGDP/A". How may I obtain the data type that is displayed as "Y%" in the data browser? I tried:


ds = DatastreamDSWS.Datastream(...)
ds.get_data(tickers="<aBRGDP/A>", fields=["Y%"], kind=1)

However the above code returns an error. The RIC is correct because if I pass None for fields it returns the None value, which is the time series level value. I tried to pass the string as r"%Y" also with no avail.

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

hi @lmotta ,

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?
If so please can you click the 'Accept' text on the left side of the appropriate reply? This will guide all community members who have a similar question.

Thanks,
AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS


1 Answer

· Write an Answer
Upvote
Accepted
78.6k 248 52 74

@lmotta

I checked and found that you need to use Datastream functions to retrieve percentage changes.

Percentage change (PCH#) calculates the percentage change between values in a series.

The code looks like this:

ds.get_data(tickers="<aBRGDP/A>", fields=["PCH#(X,-1Y)"],
            freq="M",  
            kind=1, 
            start="2010-01-01", 
            end="2022-10-12")

The output is:

1657070738090.png

However, you need to contact the Datastream support team directly via MyRefintiiv to confirm the function used to retrieve Y% values.


1657070738090.png (26.6 KiB)
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.

Thanks, I believe you are right, the Y%, etc. views on the web page are just transformations of the sort PCH(X,-Y).

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.