For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 0 0

PERCENT_CHG function not working

I'm using the Percent_chg function in TR excel formula. It's working fine in excel, but it's not available in python. How can I solve this? Is there a workaround for this?

df, err = ek.get_data("AAL.V",
['TR.PriceClose.date','TR.PriceClose','TR.COMPANYSHARESOUTSTANDING','TR.COMPANYMARKETCAP','TR.TOTALRETURN1D','PERCENT_CHG(TR.PriceClose,lag=-1D)'
],{'Sdate':'2020-01-01','Edate':'2020-05-01','FRQ':'D','CURN':'USD','SORTA':'TR.PriceClose.date'})
df

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvote
Accepted
39.2k 75 11 27

@Patricia.Pascual, @chavalit.jintamalit
PERCENT_CHG and other functions found under Parameters & Quick Functions in Formula Builder wizard in Eikon Excel can indeed be used with Eikon Data APIs.
@Patricia.Pascual, I'm not sure what you mean when you say it's not available in Python. The exact expression you put on this thread works for me and returns the same data as the equivalent expression in Eikon Excel. What does it return for you?
P.S. Make sure you use the latest version of EDAPI for Python library.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvote
18k 21 12 20

Hi @Patricia.Pascual

The excel build-in function is not available on API.

You can calculate the change in your program from the PriceClose field.


ahs.png (73.2 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea