Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 1 2

"GAVG" function in python API

Some of my Excel fromulas used the "GAVG" Function, and it worked really well. an example:

GAVG(TR.HQCountryCode,TR.GICSIndustry,TR.RevenueSmartEstLastYrGrowth,universe="EquityAll"),Curn=USD

This function does not seem to work well in the Python scripting API. sometimes it works, but most of the time it crashes, displaying the error: HTTPError: 400 Bad Request.

Is the GAVG function supported?

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apiexcelerror-400
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 @pierre.faurel,

Could you please help the client regarding this Eikon Scripting API question?

@Wessel

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

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

Upvotes
Accepted
39.4k 77 11 27

While the use of these functions is not yet officially supported through Eikon Python API, this seems to work just dandy for me:
ek.get_data(['TRI.N','IBM.N','AAPL.O'],['GAVG(TR.HQCountryCode,TR.GICSIndustry,TR.RevenueSmartEstLastYrGrowth,universe="EquityAll")'],{'Curn':'USD'})
Would you mind giving me an example, which returns Bad Request for you?

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
39.4k 77 11 27

I'm afraid the functions such as this one that you can see in Quick Functions section of Parameters & Quick Functions Tab in Formula Builder dialog in Eikon Excel cannot be used in Eikon Python API. At least not today.

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
1 0 0 0

hi, I tried above and it worked but admit getting HTTPError: 400 Bad Request occasionally.
Also Eikon Excel returns different result:

=TR("TRI.N;IBM.N;AAPL.O","TR.HQCountryCode;TR.GICSIndustry;GAVG(TR.RevenueSmartEstLastYrGrowth,universe=""EquityAll"")","CH=IN;Fd Curn=USD TRANSPOSE:Y",H8)
Apart from that I tried also % change but couldn't get it working and received HTTPError: 400 Bad Request again

ek.get_data('PZU.WA', ['PERCENT_CHG(TR.PriceClose, lag=-12D)']) 

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.