I'm trying to use Eikon Data APIs to retrieve the same data as the following Eikon Excel formula.
=TR(".SPX","PCTCHG_YTD")
The get_data() function returns NaN, while Eikon Excel returns value; for example "15.169".
>>> ek.get_data(".SPX","PCTCHG_YTD") ( Instrument PCTCHG_YTD 0 .SPX NaN, [{'code': 251658244, 'col': 1, 'message': "Error: Field 'PCTCHG_YTD' was not found in response for the instrument '.SPX'", 'row': 0}])
Could you please advise?